更新:2007 年 11 月
错误消息
由于类型“type”是“type”的嵌套类型,因此无法转发该类型
尝试转发嵌套类时会生成此错误。
示例
下面的示例生成 CS0730。它由两个源文件组成。首先,编译库文件 CS0730a.cs,然后编译引用该库文件的文件 CS0730.cs。
// CS0730a.cs
// compile with: /t:library
public class Outer
{
public class Nested {}
}
// CS0730.cs
// compile with: /t:library /r:CS0730a.dll
using System.Runtime.CompilerServices;
[assembly:TypeForwardedToAttribute(typeof(Outer.Nested))] // CS0730
[assembly:TypeForwardedToAttribute(typeof(Outer))] // OK