Browse Source

Add pretty test for compound assignment with checked operators

Compound assignments selecting between op_Addition and
op_CheckedAddition across a checked block boundary were not
covered.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/3857/head
Siegfried Pammer 4 days ago committed by Siegfried Pammer
parent
commit
b4d4c8f621
  1. 16
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Operators.cs

16
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Operators.cs

@ -294,5 +294,21 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
#endif #endif
a = num; a = num;
} }
#if CS110
public void CheckedCompoundAssign()
{
a += b;
a -= b;
checked
{
a += b;
a -= b;
a *= b;
a /= b;
}
// force end of checked block:
++a;
}
#endif
} }
} }
Loading…
Cancel
Save