Browse Source

Fix 1553: Analyzer does not find generic type references

pull/1596/head
Siegfried Pammer 7 years ago
parent
commit
fe80e1b767
  1. 6
      ILSpy/Analyzers/AnalyzerScope.cs

6
ILSpy/Analyzers/AnalyzerScope.cs

@ -130,6 +130,10 @@ namespace ICSharpCode.ILSpy.Analyzers
{ {
yield return self; yield return self;
string reflectionTypeScopeName = typeScope.Name;
if (typeScope.TypeParameterCount > 0)
reflectionTypeScopeName += "`" + typeScope.TypeParameterCount;
foreach (var assembly in AssemblyList.GetAssemblies()) { foreach (var assembly in AssemblyList.GetAssemblies()) {
ct.ThrowIfCancellationRequested(); ct.ThrowIfCancellationRequested();
bool found = false; bool found = false;
@ -145,7 +149,7 @@ namespace ICSharpCode.ILSpy.Analyzers
} }
} }
} }
if (found && ModuleReferencesScopeType(module.Metadata, typeScope.Name, typeScope.Namespace)) if (found && ModuleReferencesScopeType(module.Metadata, reflectionTypeScopeName, typeScope.Namespace))
yield return module; yield return module;
} }
} }

Loading…
Cancel
Save