From 28faea909958b209316948c1f3e6f1efc6697653 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 25 Aug 2026 06:40:17 +0200 Subject: [PATCH] Give readability names up on a copy The names that make a primitive value readable were written into the ArgumentNames array the call carries, so the step that gives them up again found them still there: for any call that already carried names of its own, turning them off was a no-op, and the ladder went on to cast instead. Assisted-by: Claude:claude-opus-5[1m]:Claude Code --- ICSharpCode.Decompiler/CSharp/CallBuilder.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ICSharpCode.Decompiler/CSharp/CallBuilder.cs b/ICSharpCode.Decompiler/CSharp/CallBuilder.cs index dcbb43124..c50e49982 100644 --- a/ICSharpCode.Decompiler/CSharp/CallBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/CallBuilder.cs @@ -77,10 +77,11 @@ namespace ICSharpCode.Decompiler.CSharp && !ParameterNames.Any(string.IsNullOrEmpty)) { Debug.Assert(skipCount == 0); - if (argumentNames == null) - { - argumentNames = new string[Arguments.Length]; - } + // On a copy: giving these names up again must leave the ones that order the + // arguments untouched. + argumentNames = argumentNames == null + ? new string[Arguments.Length] + : (string[])argumentNames.Clone(); for (int i = 0; i < Arguments.Length; i++) {