diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/lazy-locals.check | 1 | ||||
-rw-r--r-- | test/files/run/lazy-locals.scala | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check index 08d99562c2..63beca0717 100644 --- a/test/files/run/lazy-locals.check +++ b/test/files/run/lazy-locals.check @@ -81,3 +81,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 +false diff --git a/test/files/run/lazy-locals.scala b/test/files/run/lazy-locals.scala index 324f7c00e4..000f4d2faf 100644 --- a/test/files/run/lazy-locals.scala +++ b/test/files/run/lazy-locals.scala @@ -133,6 +133,11 @@ object Test extends Application { () } + def testReturnInLazyVal: Boolean = { + lazy val go = { return false } + go + } + { lazy val inCtor = "I am initialized when the constructor is run" inCtor @@ -155,4 +160,5 @@ object Test extends Application { println(testLazyRecMany(5)) testRecVal new CtorBlock + println(testReturnInLazyVal) } |