summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-07-05 23:22:43 +0000
committerPaul Phillips <paulp@improving.org>2009-07-05 23:22:43 +0000
commit26bca73b09d29a7978acdda36d2f85478343f9f4 (patch)
tree4c6f0fcf7f0dbee74b0e7572bbb41d8122882b50 /src
parent129cdce82583a07a7b18f850c287553134054867 (diff)
downloadscala-26bca73b09d29a7978acdda36d2f85478343f9f4.tar.gz
scala-26bca73b09d29a7978acdda36d2f85478343f9f4.tar.bz2
scala-26bca73b09d29a7978acdda36d2f85478343f9f4.zip
Implemented proposed strategy for #1503 and mov...
Implemented proposed strategy for #1503 and moved test case out of pending (and fixed it so it didn't throw a match error.)
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 7f7b492b79..1905cc31b5 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -1180,7 +1180,10 @@ 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 => REF(tpe.termSymbol) ANY_== scrutTree
+ 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 _ if scrutTree.tpe <:< tpe && isAnyRef(tpe) => scrutTree OBJ_!= NULL
case _ => scrutTree IS tpe
})