Closed silkfire closed 4 years ago
You can't technically define the method that way. The compiler complains.
DependencyInjection\IFluentExportStrategyConfiguration.cs(173,70,173,71): error CS0699: 'IFluentExportStrategyConfiguration<T>.As<TInterface>()' does not define type parameter 'T'
I see, a limitation of the CLR then. Very well, good to know then.
Is there a particular reason why no type constraint is enforced on the generic
.As...<>
methods?As of right now, this code would be perfectly fine to write:
scope.Export<string>.As<int>();
Ideally the implementing type parameter should be constrained: