编译器错误 CS1676
更新:2007 年 11 月
错误消息
参数“number”必须用“keyword”关键字声明
当匿名方法中的参数类型修饰符与您要将该方法强制转换为的委托的声明中使用的修饰符不同时,会出现此错误。
下面的示例生成 CS1676:
// CS1676.cs
delegate void E(ref int i);
class Errors
{
static void Main()
{
E e = delegate(out int i) { }; // CS1676
// To resolve, use the following line instead:
// E e = delegate(ref int i) { };
}
}