summaryrefslogtreecommitdiff
path: root/test/files/run/lazy-locals.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/lazy-locals.scala')
-rw-r--r--test/files/run/lazy-locals.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/lazy-locals.scala b/test/files/run/lazy-locals.scala
index 5279901795..be738a0f70 100644
--- a/test/files/run/lazy-locals.scala
+++ b/test/files/run/lazy-locals.scala
@@ -161,6 +161,28 @@ object Test extends Application {
}
}
+ // see #1589
+ object NestedLazyVals extends Application {
+ lazy val x = {
+ lazy val y = { println("forcing y"); 42; }
+ println("forcing x")
+ y
+ }
+
+ val x1 = 5 + { lazy val y = 10 ; y }
+
+ println(x)
+ println(x1)
+ }
+
+ trait TNestedLazyVals {
+ lazy val x = { lazy val y = 42; y }
+ }
+
+ object ONestedLazyVals extends Application with TNestedLazyVals {
+ println(x)
+ }
+
println(testLazy)
testLazy32
testLazy33
@@ -169,4 +191,6 @@ object Test extends Application {
testRecVal
new CtorBlock
println(testReturnInLazyVal)
+ NestedLazyVals
+ ONestedLazyVals
}