summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-11-19 21:44:06 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-11-19 21:54:19 +0100
commitb1d305388d21e3fd86660579f507889fd7b73e6f (patch)
tree6e2494fd3d5058412d678701156eb71d8b36c77a
parent77ecff775efd6ec21730ebd478722260b0f6c6b3 (diff)
downloadscala-b1d305388d21e3fd86660579f507889fd7b73e6f.tar.gz
scala-b1d305388d21e3fd86660579f507889fd7b73e6f.tar.bz2
scala-b1d305388d21e3fd86660579f507889fd7b73e6f.zip
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.
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala2
-rw-r--r--test/files/run/t7985b.scala5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 4e4a7738cb..7fb21c86d9 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.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()
diff --git a/test/files/run/t7985b.scala b/test/files/run/t7985b.scala
new file mode 100644
index 0000000000..aaf649eb28
--- /dev/null
+++ b/test/files/run/t7985b.scala
@@ -0,0 +1,5 @@
+class a { type X = Int }
+
+object Test extends App {
+ Array(1) match { case _: Array[a#X] => }
+}