Skip to content

ILSpy decides to fully qualify type name when it is not necessary #2736

@ElektroKill

Description

@ElektroKill

Input code

Input assembly with dependencies:
sample.zip

Source code:

using System.Collections.Generic;
using System.Linq;
using dnlib.DotNet;

namespace ILSpyFullyQualifyTestCase {
	public class Class1 {
		public static void TestMethod(ModuleDefMD md) {
			List<AssemblyRef> list = md.GetAssemblyRefs().ToList();
		}
	}
}

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.

using System.Collections.Generic;
using System.Linq;
using dnlib.DotNet;

public class Class1
{
	public static void TestMethod(ModuleDefMD md)
	{
		List<dnlib.DotNet.AssemblyRef> list = md.GetAssemblyRefs().ToList();
	}
}

Details

  • Product in use: ILSpy
  • Version in use: ILSpy version 8.0.0.7064-preview1

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDecompilerThe decompiler engine itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions