B
butch77
Hi!
I'd like to create a class, that inherits from a generic class type:
public class CompoundObject<T> : T where T : ObjectBase { [...] }
C# won't let me do it. and gives me the CS0689 error
I understand the compile time issue as mentioned in
http://www.thescripts.com/forum/thread447666.html
But:
1. Here I'm defining T to derive from ObjectBase, so at least there
would be a few methods to override etc.
2. The compiler should rather throw an error when trying to create the
specific generic class, chekcing whether there are any clashes with
that specific class used as type Parameter with the actual object.
In case anyone knows a workaround let me know of course.
Cheers.
I'd like to create a class, that inherits from a generic class type:
public class CompoundObject<T> : T where T : ObjectBase { [...] }
C# won't let me do it. and gives me the CS0689 error
I understand the compile time issue as mentioned in
http://www.thescripts.com/forum/thread447666.html
But:
1. Here I'm defining T to derive from ObjectBase, so at least there
would be a few methods to override etc.
2. The compiler should rather throw an error when trying to create the
specific generic class, chekcing whether there are any clashes with
that specific class used as type Parameter with the actual object.
In case anyone knows a workaround let me know of course.
Cheers.