-
Notifications
You must be signed in to change notification settings - Fork 128
Remove cecil FullName property from diagnostic messages #2449
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
Remove cecil FullName property from diagnostic messages #2449
Conversation
Cecil `FullName` properties use '/' as delimiters for nested classes, but the standard is to use '.'. GetDisplayName extension is used instead to accomplish this.
| if (Origin?.Provider is MethodDefinition method) | ||
| sb.Append (method.GetDisplayName ()); | ||
| else if (Origin?.Provider is TypeDefinition type) | ||
| else if (Origin?.Provider is MemberReference type) |
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.
While I think this is in general correct, it feels dangerous. If there can be an instance of IMemberDefinition which is not MemberReference we would now throw NotSupportedException. Which would be a regression. Quickly looking through Cecil, this should not be the case, but I don't know for sure.
Would be safer to keep the IMemberDefinition case as a fallback.
| if (Origin?.Provider is MethodDefinition method) | ||
| sb.Append (method.GetDisplayName ()); | ||
| else if (Origin?.Provider is TypeDefinition type) | ||
| else if (Origin?.Provider is MemberReference type) |
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.
nit: probably change the name from 'type', a memberReference could be several things
fcc8c0c to
86cf8f2
Compare
…are no regressions
86cf8f2 to
93fb2a7
Compare
…NameDiags Remove cecil FullName property from diagnostic messages Commit migrated from dotnet/linker@0ee8afd
Diagnostic messages would occasionally use the Cecil
FullNameproperty which uses '/' as a delimiter for nested classes. The standard is to use '.' instead. This fix usesGetDisplayName()instead to accomplish this.Fixes #2441
Customer Impact
Improves warning messages by better formatting nested type names.
Testing
Manually verified improved warning messages.
Risk
Very low - only affects warning messages.