interface IFace<T>
{
void Foo<S>() where S : T;
}
class Stuff : IFace<string>
{
// Alt+Ins, Implement interface member, explicit
}
Result:
interface IFace<T>
{
void Foo<S>() where S : T;
}
class Stuff : IFace<string>
{
void IFace<string>.Foo<S>() where S : string // error CS0460: Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly
{
thrownew NotImplementedException();
}
}
Do not insert 'where' clause in explicit implementation.
Also, do not suggest to implement implicitly, if it would produce incorrect constraint (for example, sealed class constraint)
Description
interface IFace<T>
{
void Foo<S>() where S : T;
}
class Stuff : IFace<string>
{
// Alt+Ins, Implement interface member, explicit
}
Result:
interface IFace<T>
{
void Foo<S>() where S : T;
}
class Stuff : IFace<string>
{
void IFace<string>.Foo<S>() where S : string // error CS0460: Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly
{
thrownew NotImplementedException();
}
}
Do not insert 'where' clause in explicit implementation.
Also, do not suggest to implement implicitly, if it would produce incorrect constraint (for example, sealed class constraint)