编译器警告(等级 1)CS3027
更新:2007 年 11 月
错误消息
“type_1”不符合 CLS,因为基接口“type_2”不符合 CLS
只有符合 CLS 的类型才能作为符合 CLS 的类型的基类型。
示例
下面的示例包含一个接口,此接口具有一个方法,可在其签名中使用不符合 CLS 的类型,从而使其类型不符合 CLS。
// CS3027.cs
// compile with: /target:library
public interface IBase
{
void IMethod(uint i);
}
下面的示例生成 CS3027。
// CS3027_b.cs
// compile with: /reference:CS3027.dll /target:library /W:1
[assembly:System.CLSCompliant(true)]
public interface IDerived : IBase {}