Compiler Error CS0306
The type 'type' may not be used as a type argument
The type used as a type parameter is not allowed. This could be because the type is a pointer type.
The following example generates CS0306:
// CS0306.cs
class C<T>
{
}
class M
{
// CS0306 – int* not allowed as a type parameter
C<int*> f;
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: