diff options
author | Burak Emir <emir@epfl.ch> | 2007-08-23 09:14:33 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-08-23 09:14:33 +0000 |
commit | 62cd29a17818625f9a0ec84ffdac827281ae6265 (patch) | |
tree | 1bf0f6fc977cb306085d62b7a0df549ac82d0785 /src | |
parent | 1ce5ecc912833a4452e1de23c6bb2fd859d66bd4 (diff) | |
download | scala-62cd29a17818625f9a0ec84ffdac827281ae6265.tar.gz scala-62cd29a17818625f9a0ec84ffdac827281ae6265.tar.bz2 scala-62cd29a17818625f9a0ec84ffdac827281ae6265.zip |
fix #1286
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/PatternMatchers.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala index 7880070f6e..74d654a267 100644 --- a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala +++ b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala @@ -267,7 +267,7 @@ trait PatternMatchers { self: transform.ExplicitOuter with PatternNodes with Par } else { isImplemented(xs, guard) } - case p @ Ident(n) => null // if(n!= nme.WILDCARD && p.symbol.) CantHandleIdent else null + case p @ Ident(n) => if(guard eq EmptyTree) null else CantHandleGuard //case UnApply(fn,xs) => isImplemented(xs, guard) case UnApply(fn,xs) => @@ -275,7 +275,7 @@ trait PatternMatchers { self: transform.ExplicitOuter with PatternNodes with Par // List.unapply<...>(xs) case Apply(TypeApply(sel @ Select(stor, nme.unapplySeq),_),_) if(stor.symbol eq definitions.ListModule) => (xs: @unchecked) match { - case ArrayValue(_,ys)::Nil => return {if(guard eq EmptyTree) isImplemented(ys, guard) else CantHandleSeq } + case ArrayValue(_,ys)::Nil => return {if(guard eq EmptyTree) isImplemented(ys, guard) else CantHandleGuard } } // ignore other unapplySeq occurrences, since will run into ArrayValue @@ -286,8 +286,8 @@ trait PatternMatchers { self: transform.ExplicitOuter with PatternNodes with Par case Bind(n, p) => isImplemented(p , guard) case Alternative(xs) => isImplemented(xs, guard) case p:Literal => null - case p:Select => null - case p:Typed => null + case p:Select => if(guard eq EmptyTree) null else CantHandleGuard + case p:Typed => if(guard eq EmptyTree) null else CantHandleGuard // ArrayValue nodes can also appear in repeated parameter positions of case classes (e.g. xml.Elem) case ArrayValue(_,xs) => CantHandleSeq |