From a7f12d2e14eabf0a915e2b306f5a624012c239fe Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Tue, 3 Jun 2008 10:13:48 +0000 Subject: Fixed #948. --- test/files/run/lazy-locals.check | 1 + test/files/run/lazy-locals.scala | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'test') 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 } -- cgit v1.2.3