diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-07-03 15:55:20 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-07-03 15:55:20 +0000 |
commit | 72597908f803fbf709bf8af8379ca10c7cfd7639 (patch) | |
tree | 201dc7851aa150f9854dafaf8a190bde52ce9d9a /test/files/run/lazy-exprs.scala | |
parent | 5eb0d12474176dfa4c4ccca6e5f1221493c96387 (diff) | |
download | scala-72597908f803fbf709bf8af8379ca10c7cfd7639.tar.gz scala-72597908f803fbf709bf8af8379ca10c7cfd7639.tar.bz2 scala-72597908f803fbf709bf8af8379ca10c7cfd7639.zip |
Fixed lazy vals to allow for patterns.
Diffstat (limited to 'test/files/run/lazy-exprs.scala')
-rw-r--r-- | test/files/run/lazy-exprs.scala | 11 |
1 files changed, 11 insertions, 0 deletions
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 } } |