@@ -610,7 +610,7 @@ public override MethodDesc ResolveVariantInterfaceMethodToStaticVirtualMethodOnT
610
610
// function returns null if the interface method implementation is not defined by the current type in
611
611
// the hierarchy.For variance to work correctly, this requires that interfaces be queried in correct order.
612
612
// See current interface call resolution for details on how that happens.
613
- private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType ( MethodDesc interfaceMethod , MetadataType currentType )
613
+ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType ( MethodDesc interfaceMethod , MetadataType currentType , bool returnRecursive = false )
614
614
{
615
615
Debug . Assert ( ! interfaceMethod . Signature . IsStatic ) ;
616
616
@@ -665,7 +665,7 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc
665
665
MethodDesc baseClassImplementationOfInterfaceMethod = ResolveInterfaceMethodToVirtualMethodOnTypeRecursive ( interfaceMethod , baseType ) ;
666
666
if ( baseClassImplementationOfInterfaceMethod != null )
667
667
{
668
- return null ;
668
+ return returnRecursive ? baseClassImplementationOfInterfaceMethod : null ;
669
669
}
670
670
else
671
671
{
@@ -716,6 +716,7 @@ public static MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(Meth
716
716
// Helper routine used during implicit interface implementation discovery
717
717
private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnTypeRecursive ( MethodDesc interfaceMethod , MetadataType currentType )
718
718
{
719
+ MethodDesc savedResult = null ;
719
720
while ( true )
720
721
{
721
722
if ( currentType == null )
@@ -729,7 +730,7 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnTypeRecursive(M
729
730
return null ;
730
731
}
731
732
732
- MethodDesc currentTypeInterfaceResolution = ResolveInterfaceMethodToVirtualMethodOnType ( interfaceMethod , currentType ) ;
733
+ MethodDesc currentTypeInterfaceResolution = ResolveInterfaceMethodToVirtualMethodOnType ( interfaceMethod , currentType , returnRecursive : true ) ;
733
734
if ( currentTypeInterfaceResolution != null )
734
735
return currentTypeInterfaceResolution ;
735
736
0 commit comments