Merge pull request #9518 from cston/9131
Include HasValue check in BoundSwitchStatement If the switch expression is a Nullable<T> a conditional branch is added for the HasValue check. That check was added as a separate BoundStatement outside of the BoundSwitchStatement . If the lambda rewriter subsequently generated any display class instances, the allocations are added as a prologue to the rewritten switch statement but since the conditional branch is outside the switch statement, the branch skips the prologue, skipping the allocations. The change is to include the conditional branch in the BoundSwitchStatement so the branch occurs after the prologue.
Showing
想要评论请 注册 或 登录