編譯器錯誤 CS0766
更新:2007 年 11 月
錯誤訊息
部分方法必須有 void 傳回型別。
部分方法無法傳回值。它的傳回型別必須是 void。
若要更正這個錯誤
- 指定部分方法的 void 傳回型別,或將方法轉換為規則性 (非部分) 方法。
範例
下列範例會產生 CS0766:
// cs0766.cs
using System;
public partial class C
{
partial int Part(); // CS0766
// Typically the implementing declaration
// is contained in a separate file.
partial int Part() //CS0766
{
}
public static int Main()
{
return 1;
}
}