Suboptimal code for matching nullable value to constant pattern #42912
Labels
Area-Compilers
Code Gen Quality
Room for improvement in the quality of the compiler's generated code
Feature Request
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
New Language Feature - Pattern Matching
Pattern Matching
Projects
Milestone
See https://sharplab.io/#v2:EYLgZgpghgLgrgJwgZwLQAdYwggdsgZgB8ABARgDYACEgJhrIHYBYAKAG82ruaCHrgAe0EAbKgElkAQQDG8KCIAUAS1wwA/FQAeASioBeAHzaqy5FTIBuKlx4k+5AcLGSAolvQQ5EACYq1mroGxloG+haWbAC+bGxAA=
This issue is extracted from #31494
For source
The generated code is
The point is that we optimized
==
to avoid control-flow. We should do the same for the pattern-matching operations.The text was updated successfully, but these errors were encountered: