diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-08-24 08:33:11 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-08-24 08:37:38 +0200 |
commit | b25b37e9148bec1fc65e0749ea57ed9730a9abec (patch) | |
tree | 851a46b0684a38b0ac3b6cc4e937907e476fa9ea /test | |
parent | 811be49d3e9a45ef95df6132754e11360b19d917 (diff) | |
download | scala-b25b37e9148bec1fc65e0749ea57ed9730a9abec.tar.gz scala-b25b37e9148bec1fc65e0749ea57ed9730a9abec.tar.bz2 scala-b25b37e9148bec1fc65e0749ea57ed9730a9abec.zip |
SI-6272 Support lazy vals defined in try in template.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t6272.check | 10 | ||||
-rw-r--r-- | test/files/run/t6272.scala | 62 |
2 files changed, 72 insertions, 0 deletions
diff --git a/test/files/run/t6272.check b/test/files/run/t6272.check new file mode 100644 index 0000000000..f00c965d83 --- /dev/null +++ b/test/files/run/t6272.check @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/test/files/run/t6272.scala b/test/files/run/t6272.scala new file mode 100644 index 0000000000..174436919b --- /dev/null +++ b/test/files/run/t6272.scala @@ -0,0 +1,62 @@ +// x1, x2, and x3 resulted in: symbol variable bitmap$0 does not exist in A.<init> +object A { + + try { + lazy val x1 = 1 + println(x1) + sys.error("!") + } catch { + case _: Throwable => + lazy val x2 = 2 + println(x2) + } finally { + lazy val x3 = 3 + println(x3) + } + + if ("".isEmpty) { + lazy val x4 = 4 + println(x4) + } + + var b = true + while(b) { + lazy val x5 = 5 + println(x5) + b = false + } + + + def method { + try { + lazy val x6 = 6 + println(x6) + sys.error("!") + } catch { + case _: Throwable => + lazy val x7 = 7 + println(x7) + } finally { + lazy val x8 = 8 + println(x8) + } + + if ("".isEmpty) { + lazy val x9 = 9 + println(x9) + } + + var b = true + while(b) { + lazy val x10 = 10 + println(x10) + b = false + } + } +} + +object Test { + def main(args: Array[String]) { + A.method + } +} |