更新:2007 年 11 月
错误消息
“method”:并非所有的代码路径都返回值返回值的方法必须在所有代码路径中都具有 return 语句。有关更多信息,请参见
下面的示例生成 CS0161:
// CS0161.cs
public class Test
{
   public static int Main() // CS0161
   {
      int i = 10;
      if (i < 10)
      {
         return i;
      }
      else
      {
         // uncomment the following line to resolve
         // return 1;
      }
   }
} | |