@@ -527,15 +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
- def isSyntheticScala2Unapply (sym : Symbol ) =
537
- sym.isAllOf(SyntheticCase ) && sym.owner.is(Scala2x )
538
-
539
533
val mt : MethodType = unapp.widen match {
540
534
case mt : MethodType => mt
541
535
case pt : PolyType =>
@@ -564,9 +558,7 @@ class SpaceEngine(using Context) extends SpaceLogic {
564
558
val resTp = mt.finalResultType
565
559
566
560
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 ))
561
+ if (resTp.isRef(defn.BooleanClass ))
570
562
List ()
571
563
else {
572
564
val isUnapplySeq = unappSym.name == nme.unapplySeq
@@ -584,7 +576,7 @@ class SpaceEngine(using Context) extends SpaceLogic {
584
576
if (arity > 0 )
585
577
productSelectorTypes(resTp, unappSym.srcPos)
586
578
else {
587
- val getTp = resTp.select(nme.get).finalResultType.widen
579
+ val getTp = resTp.select(nme.get).finalResultType.widenTermRefExpr
588
580
if (argLen == 1 ) getTp :: Nil
589
581
else productSelectorTypes(getTp, unappSym.srcPos)
590
582
}
0 commit comments