Created
June 6, 2014 20:37
-
-
Save dotMorten/d80007a832e2ba178041 to your computer and use it in GitHub Desktop.
The C# Generics problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ClassA<T> where T : ClassB { } | |
public abstract class ClassB { } | |
public class SubClassB : ClassB { } | |
public class SubClassA : ClassA<SubClassB> { } | |
ClassA<ClassB> obj = new SubClassA(); //Won't compile :( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment