diff options
Diffstat (limited to 'test/files/run/bug3563.scala')
-rw-r--r-- | test/files/run/bug3563.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/bug3563.scala b/test/files/run/bug3563.scala new file mode 100644 index 0000000000..8abbb60803 --- /dev/null +++ b/test/files/run/bug3563.scala @@ -0,0 +1,21 @@ + + + + + +// ticket #3563 +object Test { + + def main(args: Array[String]) { + var sum = 0 + val setseq = Set(1, 2, 3, 4).toSeq + setseq.map( n => { sum += n; n * n }).head + assert(sum == 10) + + sum = 0 + val mapseq = Map(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4).toSeq + mapseq.map( n => { sum += n._1; (n._1 + n._1, n._2 * n._2) }).head + assert(sum == 10) + } + +} |