Make expression trees involving enum literals to look like produced by native compiler
Native compiler exposes results of constant folding in the expression trees. In particular, conversion from an enum literal to an underlying type is fairly consistently folded by the native compiler as it can be observed in the expression trees. Roslyn, on the other hand, was not very consistent here. Some cases like explicitly converted literals were folded - Ex: IntTakingMethod((int)E1.a) Other cases like implicit conversions to underlying type introduced in the processs of type promotion in binary expressions were not. This fixes known differences in this behavior. Fixes #4085 Fixes #3292
Showing
想要评论请 注册 或 登录