Skip to content

Commit 8a67f48

Browse files
Fix #1956: Adapt previous fix for variable names that have a number as suffix.
1 parent ffcd468 commit 8a67f48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ICSharpCode.Decompiler/IL/Transforms/AssignVariableNames.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ static bool IsSetOrEventAccessor(IMethod method)
215215
if (variables.TryGetValue(i, out var v))
216216
variableMapping[v] = p.Name;
217217
}
218-
if (!parentScope.IsReservedVariableName(p.Name, out _))
218+
string nameWithoutNumber = SplitName(p.Name, out int newIndex);
219+
if (!parentScope.IsReservedVariableName(nameWithoutNumber, out _))
219220
{
220221
AddExistingName(reservedVariableNames, p.Name);
221222
if (variables.TryGetValue(i, out var v))

0 commit comments

Comments
 (0)