編譯器錯誤 CS0730
更新: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