From 35a9ac7e74f24153e83c6c6c8c7960da91870439 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 28 Apr 2020 19:15:57 +0200 Subject: [PATCH] Fix #1992: Analyzer fails to find usages of a type when it is used as a type argument --- ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs b/ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs index 862bc162f..744a46991 100644 --- a/ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs +++ b/ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs @@ -82,6 +82,10 @@ namespace ICSharpCode.ILSpy.Analyzers.Builtin method.ReturnType.AcceptVisitor(visitor); + foreach (var t in method.TypeArguments) { + t.AcceptVisitor(visitor); + } + if (scanBodies && !visitor.Found) ScanMethodBody(visitor, method, context.GetMethodBody(method), context);