Handle generics in methodimpls for default interface methods (#20404)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Tue, 13 Nov 2018 13:01:34 +0000 (14:01 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Nov 2018 13:01:34 +0000 (14:01 +0100)
commite95c1f8fe6ae185b90b807170445c2e26cfbed66
tree4b2df5f1ad907ac97a3a95ce96ee7a063061d015
parentaf659aff6dc7f91a3b82d5e39d877e69b567e580
Handle generics in methodimpls for default interface methods (#20404)

The existing logic looking at MethodImpls to find the default interface implementation was not correct in the presence of generics. The MethodImpl records we build during type load only contain inexact MethodDescs for the declMethod that are not suitable for comparisons.

The fix is to pipe through the token and resolve the declaring method from it at the time of dispatch.
src/vm/methodimpl.cpp
src/vm/methodimpl.h
src/vm/methodtable.cpp
src/vm/methodtablebuilder.cpp
src/vm/methodtablebuilder.h
tests/src/Regressions/coreclr/16354/notimplemented.il [new file with mode: 0644]
tests/src/Regressions/coreclr/16354/notimplemented.ilproj [new file with mode: 0644]
tests/src/Regressions/coreclr/16355/boring.il [new file with mode: 0644]
tests/src/Regressions/coreclr/16355/boring.ilproj [new file with mode: 0644]
tests/src/Regressions/coreclr/16355/variance.il [new file with mode: 0644]
tests/src/Regressions/coreclr/16355/variance.ilproj [new file with mode: 0644]