【发布时间】:2016-04-27 09:33:37
【问题描述】:
为什么第一个测试会引发编译器错误,而第二个不会?在我看来,它们在语义上是等价的。
public bool? inlineTest(bool input)
{
return input ? null : input;
}
public bool? expandedTest(bool input)
{
if (input)
return input;
else
return null;
}
【问题讨论】:
标签: c#