summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala5
-rw-r--r--test/files/run/patmatnew.scala7
-rw-r--r--test/pending/run/castsingleton.check (renamed from test/files/run/castsingleton.check)0
-rw-r--r--test/pending/run/castsingleton.scala (renamed from test/files/run/castsingleton.scala)3
4 files changed, 4 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 3278e4508b..941777c030 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -1239,10 +1239,7 @@ trait ParallelMatching extends ast.TreeDSL {
case v @ Constant(null) if isAnyRef(scrutTree.tpe) => scrutTree ANY_EQ NULL
case v => scrutTree ANY_== Literal(v)
}
- case _: SingletonType if useEqTest =>
- // See ticket #1503 for why both these checks are necessary.
- (REF(tpe.termSymbol) ANY_== scrutTree) AND (scrutTree IS tpe.widen)
-
+ case _: SingletonType if useEqTest => REF(tpe.termSymbol) ANY_== scrutTree
case _ if scrutTree.tpe <:< tpe && isAnyRef(tpe) => scrutTree OBJ_!= NULL
case _ => scrutTree IS tpe
})
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index 26083a7c1b..025d6bf2ef 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -880,11 +880,8 @@ object C {
}
override def runTest() {
- // 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)) ))
+ assertTrue(empty( new L(Nil) ))
+ assertTrue(singleton( new L(List(1)) ))
}
} // end Ticket346
diff --git a/test/files/run/castsingleton.check b/test/pending/run/castsingleton.check
index 49742281f0..49742281f0 100644
--- a/test/files/run/castsingleton.check
+++ b/test/pending/run/castsingleton.check
diff --git a/test/files/run/castsingleton.scala b/test/pending/run/castsingleton.scala
index f907467741..171b380dc9 100644
--- a/test/files/run/castsingleton.scala
+++ b/test/pending/run/castsingleton.scala
@@ -3,8 +3,7 @@ object Test extends Application {
object N extends L();
def empty(xs : L) : Unit = xs match {
- case x@N => println(x); println(x);
- case x => println(x); println(x);
+ case x@N => println(x); println(x);
}
empty(L())