@@ -384,7 +384,7 @@ object Types {
384
384
385
385
/** The base classes of this type as determined by ClassDenotation
386
386
* in linearization order, with the class itself as first element.
387
- * For AndTypes/OrTypes, the union /intersection of the operands' baseclasses.
387
+ * For AndTypes/OrTypes, the merge /intersection of the operands' baseclasses.
388
388
* Inherited by all type proxies. `Nil` for all other types.
389
389
*/
390
390
final def baseClasses (implicit ctx : Context ): List [ClassSymbol ] = track(" baseClasses" ) {
@@ -475,22 +475,24 @@ object Types {
475
475
*/
476
476
final def findMember (name : Name , pre : Type , excluded : FlagSet )(implicit ctx : Context ): Denotation = {
477
477
@ tailrec def go (tp : Type ): Denotation = tp match {
478
- case tp : RefinedType =>
479
- if (name eq tp.refinedName) goRefined(tp) else go(tp.parent)
480
- case tp : ThisType =>
481
- goThis(tp)
482
- case tp : TypeRef =>
483
- tp.denot.findMember(name, pre, excluded)
484
478
case tp : TermRef =>
485
479
go (tp.underlying match {
486
480
case mt : MethodType
487
481
if mt.paramInfos.isEmpty && (tp.symbol is Stable ) => mt.resultType
488
482
case tp1 => tp1
489
483
})
490
- case tp : TypeParamRef =>
491
- goParam(tp)
484
+ case tp : TypeRef =>
485
+ tp.denot.findMember(name, pre, excluded)
486
+ case tp : ThisType =>
487
+ goThis(tp)
488
+ case tp : RefinedType =>
489
+ if (name eq tp.refinedName) goRefined(tp) else go(tp.parent)
492
490
case tp : RecType =>
493
491
goRec(tp)
492
+ case tp : TypeParamRef =>
493
+ goParam(tp)
494
+ case tp : SuperType =>
495
+ goSuper(tp)
494
496
case tp : HKApply =>
495
497
goApply(tp)
496
498
case tp : TypeProxy =>
@@ -614,6 +616,12 @@ object Types {
614
616
go(next)
615
617
}
616
618
}
619
+ def goSuper (tp : SuperType ) = go(tp.underlying) match {
620
+ case d : JointRefDenotation =>
621
+ typr.println(i " redirecting super. $name from $tp to ${d.symbol.showLocated}" )
622
+ new UniqueRefDenotation (d.symbol, tp.memberInfo(d.symbol), d.validFor)
623
+ case d => d
624
+ }
617
625
def goAnd (l : Type , r : Type ) = {
618
626
go(l) & (go(r), pre, safeIntersection = ctx.pendingMemberSearches.contains(name))
619
627
}
0 commit comments