Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2019-02-03 21:22:32 +0300
committerThays Grazia <thaystg@gmail.com>2019-04-18 18:01:32 +0300
commitef45232b9efb735c9f83774fd069bb6367a96854 (patch)
treeb426a7f8556c54d7b691c823013d843c05b63848
parent1db45a411293d1c7ac09f7b071228fa9e8906b65 (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.cs1
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/AmbiguousImplementationException.cs3
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)