Bizarre ternary operator behavior in debugger on x64 platform

前端 未结 2 1962
日久生厌
日久生厌 2021-01-17 13:03

I\'m using a very simple ternary expression in my C# code:

helperClass.SomeData = helperClass.HasData ? GetSomeData() : GetSomeOtherData();

2条回答
  •  我在风中等你
    2021-01-17 13:50

    to me this doesn't seem a bug in the debugger but possibly of the compiler...

    when changing the code to

    { helperClass.SomeData = helperClass.HasData ? GetSomeData() : GetSomeOtherData(); }
    

    the IL generated is different and the debugger works as expected...

提交回复
热议问题