Registration calls from generic type result in compile-time error
MGRussell opened this issue · comments
MGRussell commented
public static void RegisterService<TConcrete>()
{
SplatRegistrations.Register<TConcrete>();
}
The above method results in a SPLATDI001 error (TConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute) that is not related to the type being used. The error appears even if the method is not called.
Glenn commented
The scenario won't work. It can definitely have a better error message though
The splat registrations calls need concrete types not generics due to the way source generators work
So calling within another generic method is unsupported
github-actions commented
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.