summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-07-03 15:55:20 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-07-03 15:55:20 +0000
commit72597908f803fbf709bf8af8379ca10c7cfd7639 (patch)
tree201dc7851aa150f9854dafaf8a190bde52ce9d9a /test
parent5eb0d12474176dfa4c4ccca6e5f1221493c96387 (diff)
downloadscala-72597908f803fbf709bf8af8379ca10c7cfd7639.tar.gz
scala-72597908f803fbf709bf8af8379ca10c7cfd7639.tar.bz2
scala-72597908f803fbf709bf8af8379ca10c7cfd7639.zip
Fixed lazy vals to allow for patterns.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/lazy-exprs.check3
-rw-r--r--test/files/run/lazy-exprs.scala11
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/lazy-exprs.check b/test/files/run/lazy-exprs.check
index 2aaa0be3f6..e77d204251 100644
--- a/test/files/run/lazy-exprs.check
+++ b/test/files/run/lazy-exprs.check
@@ -8,3 +8,6 @@ lazy val in if condition: forced <z1>
ok
lazy val in pattern: forced LazyField
ok
+lazy val with patterns:
+x and y: xy(x, y)
+x1 and y1: x1y1(x1, y1)
diff --git a/test/files/run/lazy-exprs.scala b/test/files/run/lazy-exprs.scala
index 307915bcac..8a80423646 100644
--- a/test/files/run/lazy-exprs.scala
+++ b/test/files/run/lazy-exprs.scala
@@ -68,12 +68,23 @@ object TestExpressions {
}
}
+ lazy val (x, y) = ({print("x"); "x"}, {print("y"); "y"})
+ def testPatLazyVal {
+ println("lazy val with patterns:")
+ print("x and y: ")
+ println("(" + x + ", " + y + ")")
+ lazy val (x1, y1) = ({print("x1"); "x1"}, {print("y1"); "y1"})
+ print("x1 and y1: ")
+ println("(" + x1 + ", " + y1 + ")")
+ }
+
def test {
patmatchScrut
patmatchCase
patmatchPat
ifcond
testPatMatchField
+ testPatLazyVal
}
}