编译器警告(等级 1)CS3015
更新:2007 年 11 月
错误消息
“method signature”没有只使用符合 CLS 类型的可访问的构造函数
为了符合公共语言规范 (CLS),属性类的参数列表不能包含数组。有关 CLS 遵从性的更多信息,请参见编写符合 CLS 的代码和公共语言规范。
示例
下面的示例生成 C3015。
// CS3015.cs
// compile with: /target:library
using System;
[assembly:CLSCompliant(true)]
public class MyAttribute : Attribute
{
public MyAttribute(int[] ai) {} // CS3015
// try the following line instead
// public MyAttribute(int ai) {}
}