From 069e0a6ec625e0ba8995cfed5bb9653bc5ba5241 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 4 Jul 2026 13:13:35 +0200 Subject: [PATCH] Add pretty tests for dynamic in loop conditions and conditional calls dynamic used as a while-loop condition and the null-conditional invocation operator on a dynamic receiver were not covered. Assisted-by: Claude:claude-fable-5:Claude Code --- .../TestCases/Pretty/DynamicTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs index 39a809f48..5422c148c 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs @@ -576,6 +576,21 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty return ref o; } #endif + + private static void WhileDynamic(dynamic a) + { + while (a) + { + Console.WriteLine("x"); + } + } + +#if CS60 + private static void NullConditionalInvocation(dynamic a) + { + a?.Call(); + } +#endif } internal static class Extension