diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2019-02-03 21:22:32 +0300 |
---|---|---|
committer | Thays Grazia <thaystg@gmail.com> | 2019-04-18 18:01:32 +0300 |
commit | ef45232b9efb735c9f83774fd069bb6367a96854 (patch) | |
tree | b426a7f8556c54d7b691c823013d843c05b63848 | |
parent | 1db45a411293d1c7ac09f7b071228fa9e8906b65 (diff) |
Throw the right exception when interface dispatch is ambiguous (#22295)
Throw the approved exception per dotnet/corefx#34124.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
-rw-r--r-- | src/System.Private.CoreLib/shared/System/HResults.cs | 1 | ||||
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/HResults.cs b/src/System.Private.CoreLib/shared/System/HResults.cs index 4a5ec0d63..9c8db2143 100644 --- a/src/System.Private.CoreLib/shared/System/HResults.cs +++ b/src/System.Private.CoreLib/shared/System/HResults.cs @@ -27,6 +27,7 @@ namespace System { internal const int S_OK = unchecked((int)0x00000000); internal const int COR_E_ABANDONEDMUTEX = unchecked((int)0x8013152D); + internal const int COR_E_AMBIGUOUSIMPLEMENTATION = unchecked((int)0x8013106A); internal const int COR_E_AMBIGUOUSMATCH = unchecked((int)0x8000211D); internal const int COR_E_APPDOMAINUNLOADED = unchecked((int)0x80131014); internal const int COR_E_APPLICATION = unchecked((int)0x80131600); diff --git a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs index 4358c65a8..1a7ef0aef 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs @@ -13,16 +13,19 @@ namespace System.Runtime public AmbiguousImplementationException() : base(SR.AmbiguousImplementationException_NullMessage) { + HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION; } public AmbiguousImplementationException(string message) : base(message) { + HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION; } public AmbiguousImplementationException(string message, Exception innerException) : base(message, innerException) { + HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION; } private AmbiguousImplementationException(SerializationInfo info, StreamingContext context) |