@@ -606,7 +606,7 @@ class CheckCaptures extends Recheck, SymTransformer:
606
606
607
607
/** Massage `actual` and `expected` types using the methods below before checking conformance */
608
608
override def checkConformsExpr (actual : Type , expected : Type , tree : Tree )(using Context ): Unit =
609
- val expected1 = makeFunctionDependent (addOuterRefs(expected, actual), actual.stripCapturing)
609
+ val expected1 = alignDependentFunction (addOuterRefs(expected, actual), actual.stripCapturing)
610
610
val actual1 = adaptBoxed(actual, expected1, tree.srcPos)
611
611
// println(i"check conforms $actual1 <<< $expected1")
612
612
super .checkConformsExpr(actual1, expected1, tree)
@@ -615,7 +615,8 @@ class CheckCaptures extends Recheck, SymTransformer:
615
615
MethodType .companion(isContextual = isContextual, isErased = isErased)(args, resultType)
616
616
.toFunctionType(isJava = false , alwaysDependent = true )
617
617
618
- private def makeFunctionDependent (expected : Type , actual : Type )(using Context ): Type =
618
+ /** Turn `expected` into a dependent function when `actual` is dependent. */
619
+ private def alignDependentFunction (expected : Type , actual : Type )(using Context ): Type =
619
620
def recur (expected : Type ): Type = expected.dealias match
620
621
case expected @ CapturingType (eparent, refs) =>
621
622
CapturingType (recur(eparent), refs, boxed = expected.isBoxed)
0 commit comments