File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,11 @@ object Checking {
222
222
// global symbols when doing the cyclicity check.
223
223
def isInteresting (prefix : Type ): Boolean = prefix.stripTypeVar match {
224
224
case NoPrefix => true
225
- case prefix : ThisType => sym.owner.isClass && prefix.cls.isContainedIn(sym.owner)
225
+ case prefix : ThisType =>
226
+ sym.owner.isClass && (
227
+ prefix.cls.isContainedIn(sym.owner) // sym reachable through outer references
228
+ || sym.owner.isContainedIn(prefix.cls) // sym reachable through member references
229
+ )
226
230
case prefix : NamedType =>
227
231
(! sym.is(Private ) && prefix.derivesFrom(sym.owner)) ||
228
232
(! prefix.symbol.isStaticOwner && isInteresting(prefix.prefix))
@@ -232,6 +236,7 @@ object Checking {
232
236
case _ : RefinedOrRecType | _ : AppliedType => true
233
237
case _ => false
234
238
}
239
+
235
240
if (isInteresting(pre)) {
236
241
val pre1 = this (pre, false , false )
237
242
if (locked.contains(tp) || tp.symbol.infoOrCompleter.isInstanceOf [NoCompleter ])
Original file line number Diff line number Diff line change @@ -98,12 +98,12 @@ object Test6 {
98
98
99
99
object Test7 {
100
100
class Fix [F [_]] {
101
- class Foo { type R >: F [T ] <: F [T ] }
101
+ class Foo { type R >: F [T ] <: F [T ] } // error: cyclic
102
102
type T = F [Foo # R ]
103
103
}
104
104
105
105
object App {
106
- type Nat = Fix [Option ]# T // error: too deep
106
+ type Nat = Fix [Option ]# T
107
107
}
108
108
}
109
109
/*
You can’t perform that action at this time.
0 commit comments