-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed generation of PrivateImplementationDetails to append module name... #1546
Conversation
/// Given an input string changes it to be acceptable as a part of a type name. | ||
/// For now we will simply replace '.' with '_'as the most common case. | ||
/// </summary> | ||
internal static string MangleForTypeNameIfNeeded(this string original) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be used at
roslyn/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
Line 296 in bf91b12
moduleId = moduleId.Replace('.', '_'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is there. - GitHub lists this as the first changed file.
👍 though please note my comment |
|
||
if (submissionSlotIndex >= 0) | ||
{ | ||
name += submissionSlotIndex.ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the slot index was inside the angle brackets and instead of the module name. Does this matter? @tmat ?
Is there a test that actually tests the netmodule-merge case? I can't seem to find it. |
@agocke - there is a test added by Neal in last change. I did not need to change it. MultipleNetmodulesWithPrivateImplementationDetails |
…ame only when dealing with netmudules. The goal of module name apending is to avoid clashes when combining multiple netmodules into multifile assembly. When building a regular assembly, appending module name is not serving any purpose and just causes unnecessary metadata differences. Also in this change - when we do apend the module name, replace '.' with '_' when that happens. For example when we build a netmodule and its name is Foo.Bar.dll More complicated name mangling schemes were discussed, but at this point we will do a simple '.' --> '_' as the least destabilizing change which is still sufficient in the most common case of having dots in the module name. Fixes dotnet#1430
Changed generation of PrivateImplementationDetails to append module name...
... only when dealing with netmudules.
The goal of module name apending is to avoid clashes when combining multiple netmodules into multifile assembly. When building a regular assembly, appending module name is not serving any purpose and just causes unnecessary metadata differences.
Also in this change - when we do apend the module name, replace '.' with
'_'
when that happens. For example when we build a netmodule and its name is Foo.Bar.dllMore complicated name mangling schemes were discussed, but at this point we will do a simple '.' --> '_' as the least destabilizing change which is still sufficient in the most common case of having dots in the module name.
Fixes #1430