编译器警告(等级 1)CS0184
更新:2007 年 11 月
错误消息
给定表达式始终不是所提供的 (“type”) 类型
表达式决不可能为 true,因为正测试的变量既没有声明为 type,也不是从 type 派生的。
下面的示例生成 CS0184:
// CS0184.cs
// compile with: /W:1
class MyClass
{
public static void Main()
{
int i = 0;
if (i is string) // CS0184
i++;
}
}