@@ -527,12 +527,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
527
527
/** Parameter types of the case class type `tp`. Adapted from `unapplyPlan` in patternMatcher */
528
528
def signature (unapp : TermRef , scrutineeTp : Type , argLen : Int ): List [Type ] = {
529
529
val unappSym = unapp.symbol
530
- def caseClass = unappSym.owner.linkedClass
531
530
532
531
// println("scrutineeTp = " + scrutineeTp.show)
533
532
534
- lazy val caseAccessors = caseClass.caseAccessors.filter(_.is(Method ))
535
-
536
533
def isSyntheticScala2Unapply (sym : Symbol ) =
537
534
sym.isAllOf(SyntheticCase ) && sym.owner.is(Scala2x )
538
535
@@ -564,9 +561,7 @@ class SpaceEngine(using Context) extends SpaceLogic {
564
561
val resTp = mt.finalResultType
565
562
566
563
val sig =
567
- if (isSyntheticScala2Unapply(unappSym) && caseAccessors.length == argLen)
568
- caseAccessors.map(_.info.asSeenFrom(mt.paramInfos.head, caseClass).widenExpr)
569
- else if (resTp.isRef(defn.BooleanClass ))
564
+ if (resTp.isRef(defn.BooleanClass ))
570
565
List ()
571
566
else {
572
567
val isUnapplySeq = unappSym.name == nme.unapplySeq
@@ -584,7 +579,7 @@ class SpaceEngine(using Context) extends SpaceLogic {
584
579
if (arity > 0 )
585
580
productSelectorTypes(resTp, unappSym.srcPos)
586
581
else {
587
- val getTp = resTp.select(nme.get).finalResultType.widen
582
+ val getTp = resTp.select(nme.get).finalResultType.widenTermRefExpr
588
583
if (argLen == 1 ) getTp :: Nil
589
584
else productSelectorTypes(getTp, unappSym.srcPos)
590
585
}
0 commit comments