Handle complex constrained calls with default interface methods (#21978)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Fri, 18 Jan 2019 12:18:49 +0000 (13:18 +0100)
committerGitHub <noreply@github.com>
Fri, 18 Jan 2019 12:18:49 +0000 (13:18 +0100)
commite3932d49956acae70e0732ff3cfde7d8dc51db67
treeaf81f360070c254d05cd1b2cd78a8440496a331d
parent0a2596ce3d7fb0253f30b2461fa910c65840f9b3
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).
src/dlls/mscorrc/mscorrc.rc
src/dlls/mscorrc/resource.h
src/vm/genericdict.cpp
tests/src/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.cs [deleted file]
tests/src/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.il