summaryrefslogtreecommitdiff
path: root/src/dlls
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2019-01-18 13:18:49 +0100
committerGitHub <noreply@github.com>2019-01-18 13:18:49 +0100
commite3932d49956acae70e0732ff3cfde7d8dc51db67 (patch)
treeaf81f360070c254d05cd1b2cd78a8440496a331d /src/dlls
parent0a2596ce3d7fb0253f30b2461fa910c65840f9b3 (diff)
downloadcoreclr-e3932d49956acae70e0732ff3cfde7d8dc51db67.tar.gz
coreclr-e3932d49956acae70e0732ff3cfde7d8dc51db67.tar.bz2
coreclr-e3932d49956acae70e0732ff3cfde7d8dc51db67.zip
Handle complex constrained calls with default interface methods (#21978)
This adds handling for the interface dispatch corner case where: * We have a constrained callsite to a method on a generic interface in shared code * The callsite cannot be statically resolved because the result of dispatch depends on the generic context * At runtime, the dispatch resolves to a default interface method This would require us to have infrastructure to build "boxing thunks" - thunks that would box their first argument before dispatching to the default interface method implementation. Since this is a corner case and the fix is actually quite involved, we're making the runtime just throw in this situation. The test is written so that it should pass both if the runtime chooses to throw, or if the runtime makes the boxing thunk (we're not hardcoding the implementation limitation).
Diffstat (limited to 'src/dlls')
-rw-r--r--src/dlls/mscorrc/mscorrc.rc1
-rw-r--r--src/dlls/mscorrc/resource.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/dlls/mscorrc/mscorrc.rc b/src/dlls/mscorrc/mscorrc.rc
index 59aa7c338f..f3244218f9 100644
--- a/src/dlls/mscorrc/mscorrc.rc
+++ b/src/dlls/mscorrc/mscorrc.rc
@@ -761,6 +761,7 @@ BEGIN
IDS_CLASSLOAD_MI_BAD_SIG "Type '%1' from assembly '%2' contains an invalid method implementation signature."
IDS_CLASSLOAD_MI_FINAL_IMPL "Method implementation on an interface '%1' from assembly '%2' must be a final method."
IDS_CLASSLOAD_AMBIGUOUS_OVERRIDE "Could not call method '%1' on interface '%2' with type '%3' from assembly '%4' because there are multiple incompatible interface methods overriding this method."
+ IDS_CLASSLOAD_UNSUPPORTED_DISPATCH "Could not make constrained call to method '%1' on interface '%2' with type '%3' from assembly '%4'. Dispatch to default interface methods is not supported in this situation."
IDS_CLASSLOAD_MISSINGMETHODRVA "Could not load type '%1' from assembly '%2' because the method '%3' has no implementation (no RVA)."
SECURITY_E_INCOMPATIBLE_EVIDENCE "Assembly '%1' already loaded without additional security evidence."
diff --git a/src/dlls/mscorrc/resource.h b/src/dlls/mscorrc/resource.h
index 735f315c33..1b71333385 100644
--- a/src/dlls/mscorrc/resource.h
+++ b/src/dlls/mscorrc/resource.h
@@ -466,6 +466,7 @@
#define IDS_EE_HWINTRINSIC_NGEN_DISALLOWED 0x1ac7
#define IDS_CLASSLOAD_MI_FINAL_IMPL 0x1ac8
#define IDS_CLASSLOAD_AMBIGUOUS_OVERRIDE 0x1ac9
+#define IDS_CLASSLOAD_UNSUPPORTED_DISPATCH 0x1aca
#define BFA_INVALID_TOKEN_TYPE 0x2001
#define BFA_INVALID_TOKEN 0x2003