重複の可能性:
C# 4.0 のクラスに一般的な差異がないのはなぜですか?
例:
interface foo<out T> where T : BaseThing { }
コンパイルする
class foo<out T> where T : BaseThing { }
ではない。
これはサポートされていないだけですか、それとも機能しない、または論理的に意味をなさない何らかの理由がありますか?
編集:誰かが疑問に思っている場合に備えて、私がやりたかったことは次のとおりです...
class BaseThing { }
class DerivedThing : BaseThing { }
class foo<out T> where T : BaseThing { }
class bar : foo<DerivedThing> { }
private void test()
{
foo<BaseThing> fooInstance = new bar();
}