File tree 2 files changed +18
-3
lines changed
src/compiler/scala/tools/nsc/typechecker
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,17 @@ abstract class RefChecks extends Transform {
97
97
private val checkedCombinations = mutable.Map [List [Symbol ], (Symbol , Type )]()
98
98
private def notYetCheckedOrAdd (rt : RefinedType , currentBase : Symbol ) = {
99
99
val seen = checkedCombinations.get(rt.parents.map(_.typeSymbol)).exists {
100
- case (prevBase, prevTp) => currentBase.isSubClass(prevBase) && rt =:= prevTp.asSeenFrom(currentBase.thisType, prevBase)
100
+ case (prevBase, prevTp) =>
101
+ val isSub = (currentBase, prevBase) match {
102
+ case (cRef : RefinementClassSymbol , pRef : RefinementClassSymbol ) =>
103
+ cRef.info.parents.map(_.typeSymbol) == pRef.info.parents.map(_.typeSymbol)
104
+ case _ =>
105
+ currentBase.isSubClass(prevBase)
106
+ }
107
+ val sameTp = rt =:= prevTp.asSeenFrom(currentBase.thisType, prevBase)
108
+ isSub && sameTp
101
109
}
102
-
103
110
if (! seen) checkedCombinations.addOne((rt.parents.map(_.typeSymbol), (currentBase, rt)))
104
-
105
111
! seen
106
112
}
107
113
Original file line number Diff line number Diff line change
1
+ object Node {
2
+ trait Root { self : Node =>
3
+ val root = this
4
+ }
5
+ }
6
+ trait Node {
7
+ def root : Node
8
+ }
9
+ final class RootNode extends Node with Node .Root
You can’t perform that action at this time.
0 commit comments