diff options
-rw-r--r-- | test/files/run/regularpatmat.check | 4 | ||||
-rw-r--r-- | test/files/run/regularpatmat.scala | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check index 9363d7baf3..e26ac2ddc3 100644 --- a/test/files/run/regularpatmat.check +++ b/test/files/run/regularpatmat.check @@ -99,7 +99,9 @@ passed ok passed ok passed ok passed ok -testMZ - bugs #132 #133b #180 +testMZ - bugs #132 #133b #180 #196 +passed ok +passed ok passed ok passed ok passed ok diff --git a/test/files/run/regularpatmat.scala b/test/files/run/regularpatmat.scala index 6e964b8f13..91cb2be12b 100644 --- a/test/files/run/regularpatmat.scala +++ b/test/files/run/regularpatmat.scala @@ -605,8 +605,17 @@ object testMZ { case _ => "default"; } + def mat(xs: List[Any]) = xs match { // bug#196 + case List(b@(()|())) => + "case, b = " + b; + + case _ =>"default"; + + } + + def main:Unit = { - System.out.println("testMZ - bugs #132 #133b #180"); + System.out.println("testMZ - bugs #132 #133b #180 #196"); test[List[Expr],String](testFoo, List(Two(),Two(),Two(),Two()), "b = Two"); test[List[Expr],String](testFoo, List(Two(),Two(),Two()), "a = Two"); test[List[Expr],String](testFoo, List(Two(),Two()), "a = Two"); @@ -619,6 +628,8 @@ object testMZ { test[List[Any],String](testBar, List(On(), On(), On()), "case"); test[List[Any],String](testBar, List(On(), On(), On(), On()), "default"); test[List[Any],String](testBar, List(On(), On(), On(), On(), On()), "default"); + test[List[Any], String](mat, List(1), "default"); + test[List[Any], String](mat, List(), "case, b = List()"); () } |