Skip to content

Commit 1c4fef2

Browse files
committed
Revert: Special treatment of dependent functions in TypeComparer
1 parent 026f1b7 commit 1c4fef2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,9 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
606606
recur(tp1, skipped2)
607607

608608
if ctx.phase == Phases.checkCapturesPhase && defn.isFunctionOrPolyType(tp2) then
609-
tp1 match
610-
case tp1: RefinedType if defn.isFunctionOrPolyType(tp1) =>
611-
return recur(tp1.refinedInfo, tp2.refinedInfo)
612-
case _ =>
613-
compareRefined
609+
hasMatchingMember(nme.apply, tp1, tp2)
610+
else
611+
compareRefined
614612
case tp2: RecType =>
615613
def compareRec = tp1.safeDealias match {
616614
case tp1: RecType =>
@@ -1988,7 +1986,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
19881986
// capture sets since that constrains inferred arguments not enough, and we
19891987
// cannot constrain them later since we would run into the "cannot constrain mapped
19901988
// type from new source" problem.
1991-
isSameType(formal1, formal2a)
1989+
isSubType(formal2a, formal1)
19921990
else if precise then
19931991
isSameTypeWhenFrozen(formal1, formal2a)
19941992
else

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ abstract class Recheck extends Phase, IdentityDenotTransformer:
349349
case _ =>
350350
val actual = tpe.widenExpr
351351
val expected = pt.widenExpr
352+
//println(i"check conforms $actual <:< $expected")
352353
val isCompatible =
353354
actual <:< expected
354355
|| expected.isRepeatedParam

0 commit comments

Comments
 (0)