diff options
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 2 | ||||
-rw-r--r-- | tests/neg/cycles.scala | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index ac4c870a6..ccbbbe1b9 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -522,7 +522,7 @@ object SymDenotations { final def isStable(implicit ctx: Context) = { val isUnstable = (this is UnstableValue) || - ctx.isVolatile(info) && !hasAnnotation(defn.UncheckedStableAnnot) + is(Lazy) && ctx.isVolatile(info) && !hasAnnotation(defn.UncheckedStableAnnot) (this is Stable) || isType || { if (isUnstable) false else { setFlag(Stable); true } diff --git a/tests/neg/cycles.scala b/tests/neg/cycles.scala index 0dd24c309..a2b5e9691 100644 --- a/tests/neg/cycles.scala +++ b/tests/neg/cycles.scala @@ -1,21 +1,21 @@ -class Foo[T <: U, U <: T] +class Foo[T <: U, U <: T] // error -class Bar[T >: T] +class Bar[T >: T] // error class A { val x: T = ??? - type T <: x.type + type T <: x.type // error } class B { - type T <: x.type + type T <: x.type // error val x: T = ??? } class C { val x: D#T = ??? class D { - type T <: x.type + type T <: x.type // error val z: x.type = ??? } } @@ -23,17 +23,17 @@ class C { class E { class F { type T <: x.type - val z: x.type = ??? + val z: x.type = ??? // error } - val x: F#T = ??? + lazy val x: F#T = ??? } class T1 { - type X = (U, U) // cycle + type X = (U, U) // error type U = X & Int } class T2 { - type X = (U, U) // cycle + type X = (U, U) // error type U = X | Int } object T12 { |