File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,9 @@ object Checking {
208
208
def isInteresting (prefix : Type ): Boolean = prefix.stripTypeVar match {
209
209
case NoPrefix => true
210
210
case prefix : ThisType => sym.owner.isClass && prefix.cls.isContainedIn(sym.owner)
211
- case prefix : NamedType => ! prefix.symbol.isStaticOwner && isInteresting(prefix.prefix)
211
+ case prefix : NamedType =>
212
+ (! sym.is(Private ) && prefix.derivesFrom(sym.owner)) ||
213
+ (! prefix.symbol.isStaticOwner && isInteresting(prefix.prefix))
212
214
case SuperType (thistp, _) => isInteresting(thistp)
213
215
case AndType (tp1, tp2) => isInteresting(tp1) || isInteresting(tp2)
214
216
case OrType (tp1, tp2) => isInteresting(tp1) && isInteresting(tp2)
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class C {
23
23
24
24
class E {
25
25
class F {
26
- type T <: x.type // old- error: not stable
26
+ type T <: x.type // error
27
27
val z : x.type = ??? // old-error: not stable
28
28
}
29
29
lazy val x : F # T = ???
Original file line number Diff line number Diff line change
1
+ class Base {
2
+ type A = { // error: illegal cyclic reference: alias Object{m: Foo.B} of type B refers back to the type itself
3
+ val m : Foo .A
4
+ }
5
+
6
+ protected type B = { // error: illegal cyclic reference: alias Object{m: Foo.B} of type B refers back to the type itself
7
+ val m : Foo .B
8
+ }
9
+
10
+ private type C = {
11
+ val m : Foo .C // error: type `C` is not a member of Foo.type
12
+ }
13
+
14
+ type D = { // error: illegal cyclic reference: alias Object{m: Foo.E} of type D refers back to the type itself
15
+ val m : Foo .E
16
+ }
17
+
18
+ type E = {
19
+ val m : Foo .D
20
+ }
21
+ }
22
+
23
+ object Foo extends Base
You can’t perform that action at this time.
0 commit comments