Possible Duplicate:
C# Language: generics, open/closed, bound/unbound, constructed
While doing some stuff with reflection in C#, I've noticed that some types have the type definition e.g.
Foo<,>
What is the official term for this notation?
Possible Duplicate:
C# Language: generics, open/closed, bound/unbound, constructed
While doing some stuff with reflection in C#, I've noticed that some types have the type definition e.g.
Foo<,>
What is the official term for this notation?
Type names which are missing generic parameters such as List<>
are referred to as unbound generic types. This question has a good summary of unbound generic types as well as some related terminology.
Depending on what context you are describing these types, some other terminology may be used. The C# specification uses the term "unbound generic type" to refer to something like T<>
. The .Net framework seems to prefer the terms "generic type definition" (as dasblinkenlight pointed out, see also Type.GetGenericTypeDefinition()
) or "open generic type" (see this article).
This is a type that represents a generic type definition:
var genType = typeof(Foo<int,int>);
var genTypeDef = genType.GetGenericTypeDefinition(); // Returns typeof(Foo<,>)