From 610037ef4343aabd9946088c6a9656e43a366911 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 24 Sep 2017 21:48:49 +0200 Subject: [PATCH] Use specializing type system in ILAst output to ensure consistency in debug output. --- ILSpy/Languages/ILAstLanguage.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ILSpy/Languages/ILAstLanguage.cs b/ILSpy/Languages/ILAstLanguage.cs index 7f6324118..d3da19b36 100644 --- a/ILSpy/Languages/ILAstLanguage.cs +++ b/ILSpy/Languages/ILAstLanguage.cs @@ -157,7 +157,8 @@ namespace ICSharpCode.ILSpy if (!method.HasBody) return; var typeSystem = new DecompilerTypeSystem(method.Module); - ILReader reader = new ILReader(typeSystem); + var specializingTypeSystem = typeSystem.GetSpecializingTypeSystem(new SimpleTypeResolveContext(typeSystem.Resolve(method))); + var reader = new ILReader(specializingTypeSystem); reader.UseDebugSymbols = options.DecompilerSettings.UseDebugSymbols; ILFunction il = reader.ReadIL(method.Body, options.CancellationToken); ILTransformContext context = new ILTransformContext {