From da983e256733caf8b0185537167fa878d97f417d Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Thu, 22 Apr 2021 13:34:36 -0700 Subject: [PATCH] Handle generic methods --- src/coreclr/vm/methodtable.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index 747831bb73642a..766477f9ed5189 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -9246,7 +9246,7 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD) { COMPlusThrow(kTypeLoadException, E_FAIL); } - if (pMethodDecl != pInterfaceMD) + if (!pMethodDecl->HasSameMethodDefAs(pInterfaceMD)) { continue; } @@ -9260,7 +9260,15 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD) { COMPlusThrow(kTypeLoadException, E_FAIL); } - return pMethodImpl; + + if (pInterfaceMD->HasMethodInstantiation()) + { + return pMethodImpl->FindOrCreateAssociatedMethodDesc(pMethodImpl, this, FALSE, pInterfaceMD->GetMethodInstantiation(), TRUE); + } + else + { + return pMethodImpl; + } } return nullptr;