@@ -521,10 +521,10 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
521
521
inContext(ctx.fresh.setNewTyperState()) {
522
522
val tvars = pt.paramInfos.map(newTypeVar)
523
523
val mt = pt.instantiate(tvars).asInstanceOf [MethodType ]
524
+ // println("mt.paramInfos(0) = " + mt.paramInfos(0))
524
525
scrutineeTp <:< mt.paramInfos(0 )
525
- instantiateSelected(mt, tvars)
526
- // isFullyDefined(mt, ForceDegree.flipBottom)
527
- // println("mt = " + mt.show)
526
+ isFullyDefined(mt, ForceDegree .flipBottom)
527
+ // println("mt = " + mt)
528
528
mt
529
529
}
530
530
}
@@ -539,32 +539,32 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
539
539
// Case unapplySeq:
540
540
// 1. return the type `List[T]` where `T` is the element type of the unapplySeq return type `Seq[T]`
541
541
542
+ val resTp = mt.finalResultType
543
+
542
544
val sig =
543
545
if (isSyntheticScala2Unapply(unappSym) && caseAccessors.length == argLen)
544
546
caseAccessors.map(_.info.asSeenFrom(mt.paramInfos.head, caseClass).widenExpr)
545
- else if (mt.finalResultType .isRef(defn.BooleanClass ))
547
+ else if (resTp .isRef(defn.BooleanClass ))
546
548
List ()
547
549
else {
548
550
val isUnapplySeq = unappSym.name == nme.unapplySeq
549
551
550
552
if (isUnapplySeq) {
551
- val (arity, elemTp, resultTp) = unapplySeqInfo(mt.finalResultType , unappSym.sourcePos)
553
+ val (arity, elemTp, resultTp) = unapplySeqInfo(resTp , unappSym.sourcePos)
552
554
if (elemTp.exists) scalaListType.appliedTo(elemTp) :: Nil
553
555
else {
554
556
val sels = productSeqSelectors(resultTp, arity, unappSym.sourcePos)
555
557
sels.init :+ scalaListType.appliedTo(sels.last)
556
558
}
557
559
}
558
560
else {
559
- val arity = productArity(mt.finalResultType , unappSym.sourcePos)
561
+ val arity = productArity(resTp , unappSym.sourcePos)
560
562
if (arity > 0 )
561
- productSelectors(mt.finalResultType)
562
- .map(_.info.asSeenFrom(mt.finalResultType, mt.resultType.classSymbol).widenExpr)
563
+ productSelectorTypes(resTp, unappSym.sourcePos)
563
564
else {
564
- val resTp = mt.finalResultType.select(nme.get).finalResultType.widen
565
- val arity = productArity(resTp, unappSym.sourcePos)
566
- if (argLen == 1 ) resTp :: Nil
567
- else productSelectors(resTp).map(_.info.asSeenFrom(resTp, resTp.classSymbol).widenExpr)
565
+ val getTp = resTp.select(nme.get).finalResultType.widen
566
+ if (argLen == 1 ) getTp :: Nil
567
+ else productSelectorTypes(getTp, unappSym.sourcePos)
568
568
}
569
569
}
570
570
}
0 commit comments