Browse Source

#2797: Clarify exception message, if type is not found in the module being decompiled.

pull/2804/head
Siegfried Pammer 3 years ago
parent
commit
e8c4f29738
  1. 2
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

2
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -953,7 +953,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -953,7 +953,7 @@ namespace ICSharpCode.Decompiler.CSharp
if (type == null)
throw new InvalidOperationException($"Could not find type definition {fullTypeName} in type system.");
if (type.ParentModule != typeSystem.MainModule)
throw new NotSupportedException("Decompiling types that are not part of the main module is not supported.");
throw new NotSupportedException($"Type {fullTypeName} was not found in the module being decompiled, but only in {type.ParentModule.Name}");
var decompilationContext = new SimpleTypeResolveContext(typeSystem.MainModule);
var decompileRun = CreateDecompileRun();
syntaxTree = new SyntaxTree();

Loading…
Cancel
Save