Generic class implementing interface fails
- by Pitming
A meet a strange problem at compimation saying that a class does not implement an interface.
Lets say a v got a class:
public Class MyClass
{
...
}
And an interace:
public Interface IMyInterface
{
MyClass PropertyOfMyClass {get;}
}
and now a generic class:
public class MyGeneric<T> where T:MyClass
{
T PropertyOfMyClass
{
get{return ...;}
}
}
Until here everythings fine and compiles right.
But this will break at compilation time:
public class MyGeneric<T>:IMyInterace where T:MyClass
{
T PropertyOfMyClass
{
get{return ...;}
}
}
Saying that MyGeneric does not implements method of IMyInterface. But obviously it does, not ?