[Mono] UnsafeAccessor: Support ambiguous method match (#89217)
authorFan Yang <52458914+fanyang-mono@users.noreply.github.com>
Tue, 25 Jul 2023 17:25:55 +0000 (13:25 -0400)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 17:25:55 +0000 (13:25 -0400)
commit2b477aeeabc356bff43011fd75c57c725c2b4c77
tree1c069e4cf8d4002dd19b62e5c1c663459779d09b
parent0cba6f847b0540f9e08fdb374afb38b3d930fe50
[Mono] UnsafeAccessor: Support ambiguous method match (#89217)

* Support Ambiguous Match

* Stop unsafe accessor method lookup from walking the type hierarchy. And address the review feedback

* Handle the AmbiguousMatchException

* Fix test failure

* Adjust Mono function pointer comparison behavior to match with CoreCLR

* Fix ambiguous match

* Enable Verify_InheritanceMethodResolution

* Remove redundant curly braces

* Address review feedback
src/mono/mono/metadata/loader.c
src/mono/mono/metadata/marshal-lightweight.c
src/mono/mono/metadata/metadata-internals.h
src/mono/mono/metadata/metadata.c
src/mono/mono/metadata/method-builder-ilgen.c
src/mono/mono/metadata/unsafe-accessor.c
src/mono/mono/utils/mono-error-internals.h
src/mono/mono/utils/mono-error.c
src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs