From 935ba9ba3021b518dab8f22c1e5d897865777aab Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 27 Dec 2011 07:00:07 -0800 Subject: Consecutive type application. The parser through I think a quirk of history would not allow back to back type applications, like expr[T1, T2][T3, T4] Now it does, meaning the only thing it can: val n0 = Partial[immutable.HashMap][String][Int] ++ Seq(("a", 1)) val n1 = Partial.apply[immutable.HashMap].apply[String].apply[Int] ++ Seq(("a", 1)) assert(n0 == n1) --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index e27d5cacda..00ac3976a9 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1534,9 +1534,10 @@ self => val t1 = stripParens(t) t1 match { case Ident(_) | Select(_, _) => - val tapp = atPos(t1.pos.startOrPoint, in.offset) { - TypeApply(t1, exprTypeArgs()) - } + var tapp: Tree = t1 + while (in.token == LBRACKET) + tapp = atPos(tapp.pos.startOrPoint, in.offset)(TypeApply(tapp, exprTypeArgs())) + simpleExprRest(tapp, true) case _ => t1 -- cgit v1.2.3