Add message for AmbiguousMatchException (#84512)
authorMarc Brooks <IDisposable@gmail.com>
Wed, 31 May 2023 17:52:05 +0000 (12:52 -0500)
committerGitHub <noreply@github.com>
Wed, 31 May 2023 17:52:05 +0000 (10:52 -0700)
commitc75b8e068f7743babd623461a43d4cf7e1d39da4
treeef36af8cb3fe06c29bd7ffb4c93eae57c274ef5b
parenta93feda588300066145d6a25b2548d98b5b2d067
Add message for AmbiguousMatchException (#84512)

Add information to what is ambiguously matched when an AmbiguousMatchException is thrown as we know what we found multiple matching items for.

Renames of SR/RESX strings. Removal of `.ToString()` calls. Remove unused strings from RESX RESX string rewording.
Change the exception format string to "found for" style.
Cleanup of DefaultBinder.cs FindMostDerived* to use the local variable.
Remove copy-pasta ThrowHelper.cs instance.
Don't emit the CustomAtrributeData's type
All MemberInfo cases pass a (possibly null) `DeclaringType`.
Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
29 files changed:
src/coreclr/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Attribute.NativeAot.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/BindingFlagSupport/QueryResult.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/ThunkedApis.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.BindingFlags.cs
src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Reflection/Execution/AssemblyBinderImplementation.cs
src/coreclr/nativeaot/System.Private.TypeLoader/src/Resources/Strings.resx
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
src/libraries/System.Private.CoreLib/src/System/DefaultBinder.cs
src/libraries/System.Private.CoreLib/src/System/Reflection/AmbiguousMatchException.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/AmbiguousImplementationException.cs
src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs
src/libraries/System.Reflection.Context/src/Resources/Strings.resx
src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomType.cs
src/libraries/System.Reflection.MetadataLoadContext/src/Resources/Strings.resx
src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/DefaultBinder.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/Runtime/BindingFlagSupport/QueryResult.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/CustomAttributeHelpers.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/RuntimeTypeInfo.BindingFlags.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/Ecma/EcmaDefinitionType.BindingFlags.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoType.GetInterface.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/ThrowHelper.cs [new file with mode: 0644]
src/libraries/System.Runtime.InteropServices/src/Resources/Strings.resx
src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComAwareEventInfo.cs
src/mono/System.Private.CoreLib/src/System/Attribute.Mono.cs
src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.Mono.cs
src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs