Skip to content

Commit 87d78dc

Browse files
committed
Disable deskolemization in narrowGADTBounds
Will use deskolemize later, when method result types are inferred.
1 parent 268ce37 commit 87d78dc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,12 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi
641641
private def narrowGADTBounds(tr: NamedType, bound: Type, isUpper: Boolean): Boolean =
642642
ctx.mode.is(Mode.GADTflexible) && {
643643
val tparam = tr.symbol
644-
val bound1 = deSkolemizeIfSkolemsSeen(bound, toSuper = !isUpper)
645-
typr.println(s"narrow gadt bound of $tparam: ${tparam.info} from ${if (isUpper) "above" else "below"} to $bound1 ${bound1.isRef(tparam)}")
646-
!bound1.isRef(tparam) && {
644+
typr.println(s"narrow gadt bound of $tparam: ${tparam.info} from ${if (isUpper) "above" else "below"} to $bound ${bound.isRef(tparam)}")
645+
!bound.isRef(tparam) && {
647646
val oldBounds = ctx.gadt.bounds(tparam)
648647
val newBounds =
649-
if (isUpper) TypeBounds(oldBounds.lo, oldBounds.hi & bound1)
650-
else TypeBounds(oldBounds.lo | bound1, oldBounds.hi)
648+
if (isUpper) TypeBounds(oldBounds.lo, oldBounds.hi & bound)
649+
else TypeBounds(oldBounds.lo | bound, oldBounds.hi)
651650
isSubType(newBounds.lo, newBounds.hi) &&
652651
{ ctx.gadt.setBounds(tparam, newBounds); true }
653652
}

0 commit comments

Comments
 (0)