-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ILSpy decides to fully qualify type name when it is not necessary #2736
Comments
Is there a chance for this issue to be fixed in the upcoming previews for ILSpy 8? |
I did a bit of debugging on this issue. It looks like the problem lies in the Is CSharpRessolver supposed to return inaccessible types when instructed to resolve an identifier? A potential solution I came up with: ILSpy/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs Lines 1761 to 1764 in 5ac1350
The if condition here could be updated to if (def != null && TopLevelTypeDefinitionIsAccessible(def)) .Is this an appropriate fix? |
Input code
Input assembly with dependencies:
sample.zip
Source code:
With dnlib 3.5.0 as nuget package.
Erroneous output
ILSpy fully qualifies the
AssemblyRef
type reference when it is not necessary. This adds clutter to the decompiled code.Details
The text was updated successfully, but these errors were encountered: