Permalink
Browse files

SI-7985 Allow projection of lower-cased prefix as pattern type arg

As per the last commit, tighten up the interpretation of a lower
cased identifier meaning that we're looking at a type variable.
  • Loading branch information...
retronym committed Nov 19, 2013
1 parent 77ecff7 commit b1d305388d21e3fd86660579f507889fd7b73e6f
Showing with 6 additions and 1 deletion.
  1. +1 −1 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  2. +5 −0 test/files/run/t7985b.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) && lookingAhead(in.token != DOT) =>
+ case IDENTIFIER if nme.isVariableName(in.name) && lookingAhead(in.token != DOT && in.token != HASH) =>
atPos(start) { Bind(identForType(), EmptyTree) }
case _ =>
typ()
@@ -0,0 +1,5 @@
+class a { type X = Int }
+
+object Test extends App {
+ Array(1) match { case _: Array[a#X] => }
+}

0 comments on commit b1d3053

Please sign in to comment.