diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/lazy-exprs.check | 3 | ||||
-rw-r--r-- | test/files/run/lazy-exprs.scala | 11 |
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 } } |