Consider method accessibility in interface resolution (#81409)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Thu, 2 Feb 2023 05:27:41 +0000 (14:27 +0900)
committerGitHub <noreply@github.com>
Thu, 2 Feb 2023 05:27:41 +0000 (14:27 +0900)
commit60fa29b66b61eec7d97e7aef8f8053d17b99b351
treeb9df4cdd8153cd30b049b669e92dcc26d84629be
parentbab1596eb90d3d0a7d8db1e0c4dc3fcc2694f107
Consider method accessibility in interface resolution (#81409)

Fixes dotnet/corert#1986 (yep, all the way to CoreRT repo).

We finally found an instance where this matters - in MAUI. Non-public methods never implement an interface by name+sig combo. We got the `ProtectedDerived` case in the newly added test wrong.
src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs
src/coreclr/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs
src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs
src/coreclr/tools/Common/TypeSystem/Common/MethodForInstantiatedType.cs
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs
src/tests/nativeaot/SmokeTests/UnitTests/Interfaces.cs