Skip to content

Commit

Permalink
Check if generic types encode its arity when using GetDisplayName (#1438
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mateoatr authored Aug 24, 2020
1 parent a70f893 commit cefde0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/linker/Linker/TypeReferenceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public static StringBuilder GetDisplayNameWithoutNamespace (this TypeReference t
else
PrependGenericParameters (type.GenericParameters.Skip (declaringTypeGenericParametersCount).ToList (), sb);

simpleName = type.Name.Substring (0, type.Name.IndexOf ('`'));
int explicitArityIndex = type.Name.IndexOf ('`');
simpleName = explicitArityIndex != -1 ? type.Name.Substring (0, explicitArityIndex) : type.Name;
} else
simpleName = type.Name;

Expand Down

0 comments on commit cefde0a

Please sign in to comment.