mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Say why ref results are excluded from switch expressions
Assisted-by: Claude:claude-opus-5[1m]:Claude Code
This commit is contained in:
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)
|
||||
|
||||
Reference in New Issue
Block a user