summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/castsingleton.check2
-rw-r--r--test/files/run/castsingleton.scala11
-rw-r--r--test/files/run/patmatnew.scala7
3 files changed, 18 insertions, 2 deletions
diff --git a/test/files/run/castsingleton.check b/test/files/run/castsingleton.check
new file mode 100644
index 0000000000..49742281f0
--- /dev/null
+++ b/test/files/run/castsingleton.check
@@ -0,0 +1,2 @@
+L()
+L()
diff --git a/test/files/run/castsingleton.scala b/test/files/run/castsingleton.scala
new file mode 100644
index 0000000000..f907467741
--- /dev/null
+++ b/test/files/run/castsingleton.scala
@@ -0,0 +1,11 @@
+object Test extends Application {
+ case class L();
+ object N extends L();
+
+ def empty(xs : L) : Unit = xs match {
+ case x@N => println(x); println(x);
+ case x => println(x); println(x);
+ }
+
+ empty(L())
+}
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index a16f300414..0ab5e92099 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -876,8 +876,11 @@ object C {
}
override def runTest() {
- assertTrue(empty( new L(Nil) ))
- assertTrue(singleton( new L(List(1)) ))
+ // We no longer assert these are true, because they are no longer true!
+ // See ticket #1503 for details, but it is unsound to let L(Nil) be
+ // seen as an N by the LHS of a match.
+ // assertTrue(empty( new L(Nil) ))
+ // assertTrue(singleton( new L(List(1)) ))
}
} // end Ticket346