Perhaps we should do similar to what we did for !! and do the throw via a synthesized wrapper method. Would it be necessary to change the language of the patterns proposal before changing the implementation to use such a helper? Intuitively it seems like no.
...
If there is no such switch_expression_arm, the switch_expression throws an instance of the exception System.Runtime.CompilerServices.SwitchExpressionException.
Originally posted by @RikkiGibson in #59449 (comment)
The benefit of this change is that compiled switch expressions are easier to inline when they use a helper method instead of directly using the 'throw' instruction.
Perhaps we should do similar to what we did for !! and do the throw via a synthesized wrapper method. Would it be necessary to change the language of the patterns proposal before changing the implementation to use such a helper? Intuitively it seems like no.
Originally posted by @RikkiGibson in #59449 (comment)
The benefit of this change is that compiled switch expressions are easier to inline when they use a helper method instead of directly using the 'throw' instruction.