diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2011-10-20 22:29:20 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2011-10-20 22:29:20 +0000 |
commit | 8a9fd64129926eea35f7dca181242855f14e153f (patch) | |
tree | 4defd18749999b6e14d9fba1ccc5e1507b453a64 /test/files/run/virtpatmat_alts.scala | |
parent | 891a6e466b1b22b93c091d590178f7e5410f608e (diff) | |
download | scala-8a9fd64129926eea35f7dca181242855f14e153f.tar.gz scala-8a9fd64129926eea35f7dca181242855f14e153f.tar.bz2 scala-8a9fd64129926eea35f7dca181242855f14e153f.zip |
virtpatmat, hidden behind -Yvirtpatmat
at least one imminent TODO: undo hardwired generation of if/then/else,
and decide based on type whether to call flatMap/orElse or inline those
methods from Option
review by extempore
Diffstat (limited to 'test/files/run/virtpatmat_alts.scala')
-rw-r--r-- | test/files/run/virtpatmat_alts.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/virtpatmat_alts.scala b/test/files/run/virtpatmat_alts.scala new file mode 100644 index 0000000000..b7717524e2 --- /dev/null +++ b/test/files/run/virtpatmat_alts.scala @@ -0,0 +1,12 @@ +object Test extends App { + (true, true) match { + case (true, true) | (false, false) => 1 + } + + List(5) match { + case 1 :: Nil | 2 :: Nil => println("FAILED") + case (x@(4 | 5 | 6)) :: Nil => println("OK "+ x) + case 7 :: Nil => println("FAILED") + case Nil => println("FAILED") + } +}
\ No newline at end of file |