summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-08-28 07:05:38 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-08-28 07:05:38 -0700
commit8ca87e36baaf2b834fe49610180a4e6c3d7b7fa0 (patch)
tree739c33edfed1fa608b4213d8b5b4687e5acdaf8b /test
parentca7923dbfbdb663726eae46c6e13da2011b92972 (diff)
parentb25b37e9148bec1fc65e0749ea57ed9730a9abec (diff)
downloadscala-8ca87e36baaf2b834fe49610180a4e6c3d7b7fa0.tar.gz
scala-8ca87e36baaf2b834fe49610180a4e6c3d7b7fa0.tar.bz2
scala-8ca87e36baaf2b834fe49610180a4e6c3d7b7fa0.zip
Merge pull request #1188 from retronym/ticket/6272
SI-6272 Support lazy vals defined in try in template.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6272.check10
-rw-r--r--test/files/run/t6272.scala62
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
+ }
+}