diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/Patterns.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/Patterns.scala b/src/compiler/scala/tools/nsc/matching/Patterns.scala index 14e940d8a9..55d35bf884 100644 --- a/src/compiler/scala/tools/nsc/matching/Patterns.scala +++ b/src/compiler/scala/tools/nsc/matching/Patterns.scala @@ -325,9 +325,9 @@ trait Patterns extends ast.TreeDSL { } def unapply(x: UnApply) = condOpt(x) { case UnApply(Apply(TypeApp(tptArg), _), List(ArrayValue(_, xs))) - // make sure it's not empty or only _*, as otherwise the rewrite + // make sure it's not only _*, as otherwise the rewrite // also removes the instance check. - if xs takeWhile (x => !isStar(x)) nonEmpty => (tptArg, xs) + if (xs.isEmpty || xs.size > 1 || !isStar(xs.head)) => (tptArg, xs) } } |