@@ -126,14 +126,16 @@ object Types {
126
126
false
127
127
}
128
128
129
- /** Same as `isRef`, but follows more types: all type proxies as well as and- and or-types */
130
- private [Types ] def isWeakRef (sym : Symbol )(implicit ctx : Context ): Boolean = stripTypeVar match {
131
- case tp : NamedType => tp.info.isWeakRef(sym)
129
+ /** Does this type refer exactly to class symbol `sym`, instead of to a subclass of `sym`?
130
+ * Implemented like `isRef`, but follows more types: all type proxies as well as and- and or-types
131
+ */
132
+ private [Types ] def isTightPrefix (sym : Symbol )(implicit ctx : Context ): Boolean = stripTypeVar match {
133
+ case tp : NamedType => tp.info.isTightPrefix(sym)
132
134
case tp : ClassInfo => tp.cls eq sym
133
135
case tp : Types .ThisType => tp.cls eq sym
134
- case tp : TypeProxy => tp.underlying.isWeakRef (sym)
135
- case tp : AndType => tp.tp1.isWeakRef (sym) && tp.tp2.isWeakRef (sym)
136
- case tp : OrType => tp.tp1.isWeakRef (sym) || tp.tp2.isWeakRef (sym)
136
+ case tp : TypeProxy => tp.underlying.isTightPrefix (sym)
137
+ case tp : AndType => tp.tp1.isTightPrefix (sym) && tp.tp2.isTightPrefix (sym)
138
+ case tp : OrType => tp.tp1.isTightPrefix (sym) || tp.tp2.isTightPrefix (sym)
137
139
case _ => false
138
140
}
139
141
@@ -1229,7 +1231,7 @@ object Types {
1229
1231
case d : SymDenotation =>
1230
1232
if (this .isInstanceOf [WithFixedSym ]) d.current
1231
1233
else if (d.validFor.runId == ctx.runId || ctx.stillValid(d))
1232
- if (prefix.isWeakRef (d.owner) || d.isConstructor) d.current
1234
+ if (prefix.isTightPrefix (d.owner) || d.isConstructor) d.current
1233
1235
else recomputeMember(d) // symbol could have been overridden, recompute membership
1234
1236
else {
1235
1237
val newd = loadDenot
0 commit comments