diff --git a/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs b/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs index 844cf58f20bd7..fb6555e4d2900 100644 --- a/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs +++ b/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs @@ -202,6 +202,8 @@ private string ComputeMangledTypeName(TypeDesc type) containingType = containingType.ContainingType; } + name = prependAssemblyName + "_" + SanitizeName(name, true); + // If this is one of the well known types, use a shorter name // We know this won't conflict because all the other types are // prefixed by the assembly name. @@ -231,10 +233,6 @@ private string ComputeMangledTypeName(TypeDesc type) break; } } - else - { - name = prependAssemblyName + "_" + SanitizeName(name, true); - } // Ensure that name is unique and update our tables accordingly. name = DisambiguateName(name, deduplicator);