You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If multiple subclasses of DependencyGroup are defined and at least one of them is an anonymous class, Sinject::Container#load_groups will fail with an ArgumentError.
Both :foo and :bar are registered in the container
Actual:
The call to Sinject::Container#load_groups raises ArgumentError
No dependencies are registered.
This is caused by the container attempting to sort the DependencyGroup subclasses by name. If the class is anonymous its name, by definition, is nil and the comparison with nil raises. An anonymous DependencyGroup subclass will work if it is the onlyDependencyGroup.
The text was updated successfully, but these errors were encountered:
KevinBrowne
changed the title
Loading of DependencyGroups fails with Anonymous classes
Loading of DependencyGroups fails with anonymous classes
Feb 21, 2024
If multiple subclasses of
DependencyGroup
are defined and at least one of them is an anonymous class,Sinject::Container#load_groups
will fail with anArgumentError
.Steps to reproduce:
Expected:
No error is raised
Both
:foo
and:bar
are registered in the containerActual:
The call to
Sinject::Container#load_groups
raisesArgumentError
No dependencies are registered.
This is caused by the container attempting to sort the
DependencyGroup
subclasses by name. If the class is anonymous its name, by definition, isnil
and the comparison withnil
raises. An anonymousDependencyGroup
subclass will work if it is the onlyDependencyGroup
.The text was updated successfully, but these errors were encountered: