Enums in lambda expressions are compiled differently; consequence of overload resolution improvements?

前端 未结 1 1486
-上瘾入骨i
-上瘾入骨i 2021-01-30 15:45

While trying out the Visual Studio 2015 RC, I received a run-time error on previously working code. Given the lambda (x => x.CustomerStatusID == CustomerStatuses.Acti

相关标签:
1条回答
  • 2021-01-30 16:21

    This has nothing to do with overload resolution. The previous compiler prematurely optimized the right-hand-side of the comparison, thereby omitting the code corresponding to the source expression.

    0 讨论(0)
提交回复
热议问题