From 418b041eb4e8064b746e55373a9d66e689e86842 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 23 May 2010 18:53:46 +0000 Subject: Added tests for bugs which have been fixed sinc... Added tests for bugs which have been fixed since beta1. Closes #2691, #3020. No review. --- test/files/pos/bug2691.scala | 10 ++++++++++ test/files/pos/bug3020.scala | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/files/pos/bug2691.scala create mode 100644 test/files/pos/bug3020.scala diff --git a/test/files/pos/bug2691.scala b/test/files/pos/bug2691.scala new file mode 100644 index 0000000000..1037b53601 --- /dev/null +++ b/test/files/pos/bug2691.scala @@ -0,0 +1,10 @@ +object Breakdown { + def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) +} +object Test { + 42 match { + case Breakdown("") => // needed to trigger bug + case Breakdown("foo") => // needed to trigger bug + case Breakdown("", who) => println ("hello " + who) + } +} diff --git a/test/files/pos/bug3020.scala b/test/files/pos/bug3020.scala new file mode 100644 index 0000000000..016563e27f --- /dev/null +++ b/test/files/pos/bug3020.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + var x = true + + ( { if (x) new scala.util.Random() } .asInstanceOf[Runnable] ) + } +} + + -- cgit v1.2.3