summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/lazy-locals.check1
-rw-r--r--test/files/run/lazy-locals.scala17
2 files changed, 17 insertions, 1 deletions
diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check
index 7f65cd3db2..08d99562c2 100644
--- a/test/files/run/lazy-locals.check
+++ b/test/files/run/lazy-locals.check
@@ -80,3 +80,4 @@ forced lazy val t at n = 4
forced lazy val t at n = 5
1764
First 5 elements of ones: List(1, 1, 1, 1, 1)
+I am initialized when the constructor is run
diff --git a/test/files/run/lazy-locals.scala b/test/files/run/lazy-locals.scala
index 937b5a80c0..324f7c00e4 100644
--- a/test/files/run/lazy-locals.scala
+++ b/test/files/run/lazy-locals.scala
@@ -133,11 +133,26 @@ object Test extends Application {
()
}
+ {
+ lazy val inCtor = "I am initialized when the constructor is run"
+ inCtor
+ }
+
+ class CtorBlock {
+ {
+ lazy val inCtor = {
+ println("I am initialized when the constructor is run")
+ 42
+ }
+ inCtor
+ }
+ }
+
println(testLazy)
testLazy32
testLazy33
println(testLazyRec(5))
println(testLazyRecMany(5))
testRecVal
-
+ new CtorBlock
}