Don't consider ShadowMethods reflectable (#67421)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Sat, 2 Apr 2022 10:29:22 +0000 (19:29 +0900)
committerGitHub <noreply@github.com>
Sat, 2 Apr 2022 10:29:22 +0000 (19:29 +0900)
commite95a6582fc5e003ea7f9ab4af7c5eaa868748ede
tree7f03549b576697713229bc29bb971ddf4784c14d
parent0c1fbe03ac324d3874c5f4d79b8ad81b62359ff6
Don't consider ShadowMethods reflectable (#67421)

Fixes #65612. This regression was exposed in #62891 - we had a mismatch between what methods are considered reflectable during scanning vs during optimized compilation due to extra array being injected for reflectable `params` methods on instantiated generic types.

There are two potential fixes - either expand the set of methods considered reflectable during scanning, or limit the number of methods considered reflectable in optimized compilation. It doesn't look like we need the expanded set, so going with a restriction instead. The CI may prove me otherwise, so keeping an open mind about this.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs
src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs