diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index 2b5edad919fae4..2fd66badafe8c2 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -9196,6 +9196,7 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD, B IMDInternalImport* pMDInternalImport = GetMDImport(); HENUMInternalMethodImplHolder hEnumMethodImpl(pMDInternalImport); hr = hEnumMethodImpl.EnumMethodImplInitNoThrow(GetCl()); + SigTypeContext sigTypeContext(this); if (FAILED(hr)) { @@ -9230,16 +9231,17 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD, B MethodTable *pInterfaceMT = ClassLoader::LoadTypeDefOrRefOrSpecThrowing( GetModule(), tkParent, - NULL /*SigTypeContext*/) + &sigTypeContext) .GetMethodTable(); - if (pInterfaceMT != pInterfaceMD->GetMethodTable()) + if (pInterfaceMT != pInterfaceMD->GetMethodTable() && + pInterfaceMT->GetCanonicalMethodTable() != pInterfaceMD->GetMethodTable()) { continue; } MethodDesc *pMethodDecl = MemberLoader::GetMethodDescFromMemberDefOrRefOrSpec( GetModule(), methodDecl, - NULL /*SigTypeContext*/, + &sigTypeContext, /* strictMetadataChecks */ FALSE, /* allowInstParam */ FALSE); if (pMethodDecl == nullptr) @@ -9253,7 +9255,7 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD, B MethodDesc *pMethodImpl = MemberLoader::GetMethodDescFromMemberDefOrRefOrSpec( GetModule(), methodBody, - NULL /*SigTypeContext*/, + &sigTypeContext, /* strictMetadataChecks */ FALSE, /* allowInstParam */ FALSE); if (pMethodImpl == nullptr)