Skip to content
Browse files

SI-7985 Refactor parsing of pattern type args

Just parse as though it is a type, and post process to
add the Bind if it turns out to be a type variable.
  • Loading branch information...
1 parent b1d3053 commit 1050745dca08e1d98506b99ea03d47a602d11bc8 @retronym retronym committed Nov 19, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
View
8 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1774,10 +1774,12 @@ 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 && in.token != HASH) =>
- atPos(start) { Bind(identForType(), EmptyTree) }
case _ =>
- typ()
+ typ() match {
+ case Ident(name: TypeName) if nme.isVariableName(name) =>
+ atPos(start) { Bind(name, EmptyTree) }
+ case t => t
+ }
}
}

0 comments on commit 1050745

Please sign in to comment.
Something went wrong with that request. Please try again.