Fix CA2021 in MethodBodyScanner (#81200)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Thu, 26 Jan 2023 09:30:29 +0000 (18:30 +0900)
committerGitHub <noreply@github.com>
Thu, 26 Jan 2023 09:30:29 +0000 (18:30 +0900)
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/MethodBodyScanner.cs

index 1cf45fd..78fd901 100644 (file)
@@ -319,7 +319,7 @@ namespace ILCompiler.Dataflow
             // are the same set of methods that we discovered and scanned above.
             if (_annotations.CompilerGeneratedState.TryGetCompilerGeneratedCalleesForUserMethod(startingMethod, out List<TypeSystemEntity>? compilerGeneratedCallees))
             {
-                var calleeMethods = compilerGeneratedCallees.OfType<MethodDefinition>();
+                var calleeMethods = compilerGeneratedCallees.OfType<MethodDesc>();
                 // https://github.com/dotnet/linker/issues/2845
                 // Disabled asserts due to a bug
                 // Debug.Assert (interproceduralState.Count == 1 + calleeMethods.Count ());