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.
Expected class, delegate, enum, interface, or struct
A declaration was found that is not supported in a namespace. Inside a namespace, the compiler accepts only classes, structs, enums, interfaces, namespaces, and delegates.
Example
The following sample generates CS1518:
// CS1518.cs
namespace x
{
sealed class c1 {}; // OK
namespace f2 {}; // OK
sealed f3 {}; // CS1518
}
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.