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
We are using AnyConcreteTypeNotAlreadyRegisteredSource, and it's behaviour has changed in 4.2.0 due to this change stemming from #495.
For example we want to resolve Foo<Bar> where we have an implementation Foo<T>. The ACTNARS delegate is t => t.Name.StartsWith("Foo"). Foo<T> does not take Bar in the constructor.
ACTNARS currently (4.6.0) fails to resolve this type as it checks that Bar is registered (here
[Fact]
public void ConstructableOpenGenericsCanBeResolved()
{
var cb = new ContainerBuilder();
cb.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource(t => t.Name.StartsWith("Progress")));
var container = cb.Build();
Assert.True(container.IsRegistered<Progress<Exception>>());
Assert.NotNull(container.Resolve<Progress<Exception>>());
}
The text was updated successfully, but these errors were encountered:
droyad
changed the title
ACTNARS fails to resolve open generics
ACTNARS fails to resolve closed generics
Jun 19, 2017
Good find. We'll have to think about how best to solve this. AnyConcreteTypeNotRegisteredSource and ContravariantRegistrationSource are two great, flexible, pains in my behind. In #495 we found ACTNARS interfering with other registration sources but we really can't put special cases around Meta<T> or other source "known types." Maybe I fixed that wrong, or maybe there's more to check? Hmmm. Will have to dig in.
We are using
AnyConcreteTypeNotAlreadyRegisteredSource
, and it's behaviour has changed in 4.2.0 due to this change stemming from #495.For example we want to resolve
Foo<Bar>
where we have an implementationFoo<T>
. TheACTNARS
delegate ist => t.Name.StartsWith("Foo")
.Foo<T>
does not takeBar
in the constructor.ACTNARS
currently (4.6.0
) fails to resolve this type as it checks thatBar
is registered (hereThe text was updated successfully, but these errors were encountered: