diff options
author | Martin Odersky <odersky@gmail.com> | 2016-01-29 21:51:08 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-09 09:40:52 +0100 |
commit | 633e2ebfd42af65f8324aec87a2444bb9cec5eff (patch) | |
tree | 68425a5825bc12590dd6a3e48bb3b383155d79a0 | |
parent | cb5935ec641b5e36b1b2c7da7d25a5013dfab890 (diff) | |
download | dotty-633e2ebfd42af65f8324aec87a2444bb9cec5eff.tar.gz dotty-633e2ebfd42af65f8324aec87a2444bb9cec5eff.tar.bz2 dotty-633e2ebfd42af65f8324aec87a2444bb9cec5eff.zip |
No volatile check needed for strict vals.
-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 { |