summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-08-23 14:58:18 +0000
committerPaul Phillips <paulp@improving.org>2009-08-23 14:58:18 +0000
commit5251059ef61f459d805ccbf7d7e9470264227d23 (patch)
tree3ce98e68128769aee16f04f5a0986ca9fa0a60e3 /src/compiler
parent94e71c26a4a1d17dff3f6df74dd972c0280b655e (diff)
downloadscala-5251059ef61f459d805ccbf7d7e9470264227d23.tar.gz
scala-5251059ef61f459d805ccbf7d7e9470264227d23.tar.bz2
scala-5251059ef61f459d805ccbf7d7e9470264227d23.zip
Fix and test case for #2241.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 6dd1996074..315ce16562 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -788,7 +788,8 @@ trait ParallelMatching extends ast.TreeDSL {
protected def lengthCheck(tree: Tree, len: Int, op: TreeFunction2) = {
def compareOp = head.tpe member nme.lengthCompare // symbol for "lengthCompare" method
- typer typed op((tree.duplicate DOT compareOp)(LIT(len)), ZERO)
+ // first ascertain lhs is not null: bug #2241
+ typer typed((tree OBJ_!= NULL) AND op((tree.duplicate DOT compareOp)(LIT(len)), ZERO))
}
// precondition for matching: sequence is exactly length of arg