Compiler Error CS0730
Cannot forward type 'type' because it is a nested type of 'type'
This error is generated when you try to forward a nested class.
The following sample generates CS0730. It consists of two source files. First, compile the library file CS0730a.cs
, and the compile the file CS0730.cs
referencing the library file.
C#
// CS0730a.cs
// compile with: /t:library
public class Outer
{
public class Nested {}
}
C#
// CS0730.cs
// compile with: /t:library /r:CS0730a.dll
using System.Runtime.CompilerServices;
[assembly:TypeForwardedToAttribute(typeof(Outer.Nested))] // CS0730
[assembly:TypeForwardedToAttribute(typeof(Outer))] // OK
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: