From f59b76a6552d534d6276e971f2eeab1b266b40b6 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 4 Jul 2026 13:13:22 +0200 Subject: [PATCH] Add pretty test for checked arithmetic in expression trees AddChecked/MultiplyChecked/ConvertChecked nodes were not covered; they are pretty-printed as a checked block around the tree-building calls. Assisted-by: Claude:claude-fable-5:Claude Code --- .../TestCases/Pretty/ExpressionTrees.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs index 08be82c5d..99acb2186 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs @@ -944,6 +944,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty ToCode(null, (int? a) => a & (int?)2); ToCode(null, (int? a) => a & a); } + + public void CheckedArithmetic() + { + checked + { + ToCode(null, (int a, int b) => a + b); + ToCode(null, (int a, int b) => a - b); + ToCode(null, (int a, int b) => a * b); + ToCode(null, (int a) => (short)a); + } + } } internal static class Extensions