编译器错误 CS0622
更新:2007 年 11 月
错误消息
只能使用数组初始值设定项表达式为数组类型赋值。请尝试改用新的表达式。
在非数组的声明中使用了适合于初始化数组的语法。
示例
下面的示例生成 CS0622:
// CS0622.cs
using System;
public class Test
{
public static void Main ()
{
Test t = { new Test() }; // CS0622
// Try the following instead:
// Test[] t = { new Test() };
}
}