diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-27 07:00:07 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-27 07:06:04 -0800 |
commit | 935ba9ba3021b518dab8f22c1e5d897865777aab (patch) | |
tree | 444c2f7c375b91beb128e3f47f42f3d12934dbfc /src | |
parent | f737e35ddf43599043ab78404c4f9a13e6d02c9b (diff) | |
download | scala-935ba9ba3021b518dab8f22c1e5d897865777aab.tar.gz scala-935ba9ba3021b518dab8f22c1e5d897865777aab.tar.bz2 scala-935ba9ba3021b518dab8f22c1e5d897865777aab.zip |
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 7 |
1 files changed, 4 insertions, 3 deletions
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 |