This is not a typical type inference problem, but a general error. Barcannot deduce T2how AnotherType, because this is not true.
new Foo<SomeType>().Bar<AnotherType>(new Qux<Baz>());
, Qux<Baz> IQux<IBaz<SomeType,AnotherType>>, Bar. IQux<Baz> IQux<IBaz<SomeType,AnotherType>>, .
, Bar:
public class Foo<T1> {
public void Bar<T2,TBaz>(IQux<TBaz> baz) where TBaz:IBaz<T1,T2> { }
}
:
new Foo<SomeType>().Bar<AnotherType,Baz>(new Qux<Baz>());
.