File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,9 @@ object Checking {
206
206
def isInteresting (prefix : Type ): Boolean = prefix.stripTypeVar match {
207
207
case NoPrefix => true
208
208
case prefix : ThisType => sym.owner.isClass && prefix.cls.isContainedIn(sym.owner)
209
- case prefix : NamedType => ! prefix.symbol.isStaticOwner && isInteresting(prefix.prefix)
209
+ case prefix : NamedType =>
210
+ ! prefix.symbol.isStaticOwner &&
211
+ (pre.derivesFrom(sym.owner) || isInteresting(prefix.prefix))
210
212
case SuperType (thistp, _) => isInteresting(thistp)
211
213
case AndType (tp1, tp2) => isInteresting(tp1) || isInteresting(tp2)
212
214
case OrType (tp1, tp2) => isInteresting(tp1) && isInteresting(tp2)
Original file line number Diff line number Diff line change
1
+ class Base {
2
+ type A = { // error
3
+ val m : Foo .A
4
+ }
5
+ }
6
+
7
+ object Foo extends Base
You can’t perform that action at this time.
0 commit comments