Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'type': static types cannot be used as type arguments
Because a static type cannot be instantiated, it cannot be used as a generic argument. To resolve this error, remove the static type from the generic argument.
Example
The following sample generates CS0718:
// CS0718.cs
public static class SC
{
public static void F()
{
}
}
public class G<T>
{
}
public class CMain
{
public static void Main()
{
G<SC> gsc = new G<SC>(); // CS0718
}
}
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.