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 1cf45fd45cb5b0cedca099e07e5016f0be3187a7..78fd9019d0a5f28c34f908e8846ce25b55a1f35d 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 ());