Browse Source

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
pull/4043/head
Siegfried Pammer 3 weeks ago
parent
commit
28faea9099
  1. 9
      ICSharpCode.Decompiler/CSharp/CallBuilder.cs

9
ICSharpCode.Decompiler/CSharp/CallBuilder.cs

@ -77,10 +77,11 @@ namespace ICSharpCode.Decompiler.CSharp
&& !ParameterNames.Any(string.IsNullOrEmpty)) && !ParameterNames.Any(string.IsNullOrEmpty))
{ {
Debug.Assert(skipCount == 0); Debug.Assert(skipCount == 0);
if (argumentNames == null) // On a copy: giving these names up again must leave the ones that order the
{ // arguments untouched.
argumentNames = new string[Arguments.Length]; argumentNames = argumentNames == null
} ? new string[Arguments.Length]
: (string[])argumentNames.Clone();
for (int i = 0; i < Arguments.Length; i++) for (int i = 0; i < Arguments.Length; i++)
{ {

Loading…
Cancel
Save