Skip to content

Circular Dependency should only be an exception if no scope defined. #4

@hpebley3

Description

@hpebley3

Currently an activation exception is thrown whenever a circular dependency is found. It does not make sense to me, and I think it should be changed, that if a scope is introduced that keeps the dependency from sending the resolver into infinite recursion, then the exception should not be thrown.

In other words, currently the CircularDependenciesTests all bind the test classes as InSingletonScope and expect an exception. It seems like these tests should not expect an exception since the second instance of Foo (needed by Bar) would be the first instance already created. Another set of test cases should not bind as InSingletonScope and should expect an exception.

Is there a reasonable argument against this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions