diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-08 19:16:06 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-08 19:16:06 +0100 |
commit | e5136e1ff3aa8a483f153f0c636e73a3ba1c7574 (patch) | |
tree | ab44b4a34566cfc778ed7388fe2d500530ba99b8 /src | |
parent | 1bbebdfa6d56bab7d14d3beef978eb9ada382191 (diff) | |
download | dotty-e5136e1ff3aa8a483f153f0c636e73a3ba1c7574.tar.gz dotty-e5136e1ff3aa8a483f153f0c636e73a3ba1c7574.tar.bz2 dotty-e5136e1ff3aa8a483f153f0c636e73a3ba1c7574.zip |
Fix to parsing infix types.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index 500ea4810..77d8c1d61 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -398,12 +398,13 @@ object Parsers { */ def infixOps( first: Tree, canStartOperand: Token => Boolean, operand: () => Tree, + isType: Boolean = false, notAnOperator: Name = nme.EMPTY, maybePostfix: Boolean = false): Tree = { val base = opStack var top = first while (isIdent && in.name != notAnOperator) { - val op = in.name + val op = if (isType) in.name.toTypeName else in.name top = reduceStack(base, top, precedence(op), isLeftAssoc(op)) opStack = OpInfo(top, op, in.offset) :: opStack ident() @@ -667,7 +668,7 @@ object Parsers { def infixType(): Tree = infixTypeRest(refinedType()) def infixTypeRest(t: Tree): Tree = - infixOps(t, canStartTypeTokens, refinedType, notAnOperator = nme.raw.STAR) + infixOps(t, canStartTypeTokens, refinedType, isType = true, notAnOperator = nme.raw.STAR) /** RefinedType ::= WithType {Annotation | [nl] Refinement} */ |