diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-06-03 10:13:48 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-06-03 10:13:48 +0000 |
commit | a7f12d2e14eabf0a915e2b306f5a624012c239fe (patch) | |
tree | 006964110166b9ed3e7eac86b1dea8b91900ae6a /test | |
parent | ba33786e9b0247bc8c796dddbbed1c69905c667e (diff) | |
download | scala-a7f12d2e14eabf0a915e2b306f5a624012c239fe.tar.gz scala-a7f12d2e14eabf0a915e2b306f5a624012c239fe.tar.bz2 scala-a7f12d2e14eabf0a915e2b306f5a624012c239fe.zip |
Fixed #948.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/lazy-locals.check | 1 | ||||
-rw-r--r-- | test/files/run/lazy-locals.scala | 17 |
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 } |