Say why ref results are excluded from switch expressions

Assisted-by: Claude:claude-opus-5[1m]:Claude Code
This commit is contained in:
Siegfried Pammer
2026-08-08 14:59:58 +02:00
committed by Siegfried Pammer
parent 076a43671e
commit 9ea8d7c6ac
@@ -676,6 +676,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
// Exactly one of resultVariable/leaveTarget must be null
if ((resultVariable == null) == (leaveTarget == null))
return;
// C# has no ref-returning switch expression: an arm cannot be `0 => ref x`.
if (resultType == StackType.Ref)
return;
if (switchInst.Value is StringToInt str2int)