Some special CLI types from mscorlib library (ArgIterator
, TypedReference
and RuntimeArgumentHandle
types) cannot be used as generic type parameters to construct the generic types / methods:
void Foo<T>() { }
void Bar() { Foo<ArgIterator>(); }
provides the compiler error:
error CS0306: The type 'System.ArgIterator' may not be used as a type argument
But this is not documented at all in the C# specification.
Is this types are a part of CLI specification or this types provided by CLR implementation and the behavior described above should not be documented at C# spec?