当我在MonoDevelop中编译我的C#项目时,出现以下错误:
条件表达式的类型无法确定为“byte”,而“int”可以隐式转换为它
代码段:
byte oldType = type;
type = bindings[type];
//Ignores updating blocks that are the same and send block only to the player
if (b == (byte)((painting || action == 1) ? type : 0))
{
if (painting || oldType != type) { SendBlockchange(x, y, z, b); } return;
}
以下是报错中被突出显示的代码行:
if (b == (byte)((painting || action == 1) ? type : 0))
非常感谢您的帮助!
String.Format("value: {0}", (value == null) ? : "null" : value)
,其中 value 的类型为int?
,该怎么办? - mr5