Permalink
Browse files

SI-7985 Allow qualified type argument in patterns

We were considering the lower case `s` in `case _: Array[scala.Int]`
as a sign that we were dealing with a type variable pattern.

Now, we only do this if a lookahead confirms the absence of a the `.`
  • Loading branch information...
1 parent c243435 commit 77ecff775efd6ec21730ebd478722260b0f6c6b3 @retronym retronym committed Nov 19, 2013
Showing with 4 additions and 1 deletion.
  1. +1 −1 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  2. +3 −0 test/files/run/t7985.scala
@@ -1774,7 +1774,7 @@ self =>
in.nextToken()
if (in.token == SUBTYPE || in.token == SUPERTYPE) wildcardType(start)
else atPos(start) { Bind(tpnme.WILDCARD, EmptyTree) }
- case IDENTIFIER if nme.isVariableName(in.name) =>
+ case IDENTIFIER if nme.isVariableName(in.name) && lookingAhead(in.token != DOT) =>
atPos(start) { Bind(identForType(), EmptyTree) }
case _ =>
typ()
@@ -0,0 +1,3 @@
+object Test extends App {
+ Array(1) match { case _: Array[scala.Int] => }
+}

0 comments on commit 77ecff7

Please sign in to comment.