当我编译我的C#项目在MonoDevelop中,我得到以下错误:类型条件表达式不能被确定为
Type of conditional expression cannot be determined as 'byte' and 'int' convert implicitly to each other
代码段:
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))
非常感谢帮助!
这是有道理的。非常感谢你! – Jakir00 2011-04-02 18:16:56
如果参数预期为任何类型,例如String.Format(“value:{0}”,(value == null)?:“null”:value),那么该怎么办?where value is type '诠释?'? – mr5 2017-05-03 08:32:06