diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-24 16:50:58 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-09-24 16:50:58 +0200 |
commit | 331e75be7e90817bc2931c3d00dd931b22c179f5 (patch) | |
tree | e9541e8aad22f3d6f8e9b4ade3eab1ad644a46c6 /src/dotty/tools/dotc/parsing/Parsers.scala | |
parent | fb710457959d1c2d4b983986141875a8fde5992b (diff) | |
download | dotty-331e75be7e90817bc2931c3d00dd931b22c179f5.tar.gz dotty-331e75be7e90817bc2931c3d00dd931b22c179f5.tar.bz2 dotty-331e75be7e90817bc2931c3d00dd931b22c179f5.zip |
Swap order of elements in Annotated
Now it's annotated first, annotation second.
This is in line with AnnotatedType and in line with the principle
that tree arguments should come in the order they are written. The
reason why the order was swapped before is historical - Scala2 did it
that way.
Diffstat (limited to 'src/dotty/tools/dotc/parsing/Parsers.scala')
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index 153b58283..b8ec38268 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -338,7 +338,7 @@ object Parsers { def isWildcard(t: Tree): Boolean = t match { case Ident(name1) => placeholderParams.nonEmpty && name1 == placeholderParams.head.name case Typed(t1, _) => isWildcard(t1) - case t: Annotated => isWildcard(t.arg) + case Annotated(t1, _) => isWildcard(t1) case Parens(t1) => isWildcard(t1) case _ => false } @@ -742,7 +742,7 @@ object Parsers { def annotType(): Tree = annotTypeRest(simpleType()) def annotTypeRest(t: Tree): Tree = - if (in.token == AT) annotTypeRest(atPos(t.pos.start) { Annotated(annot(), t) }) + if (in.token == AT) annotTypeRest(atPos(t.pos.start) { Annotated(t, annot()) }) else t /** SimpleType ::= SimpleType TypeArgs @@ -900,7 +900,7 @@ object Parsers { private final def findWildcardType(t: Tree): Option[Position] = t match { case TypeBoundsTree(_, _) => Some(t.pos) case Parens(t1) => findWildcardType(t1) - case Annotated(_, t1) => findWildcardType(t1) + case Annotated(t1, _) => findWildcardType(t1) case _ => None } @@ -1071,7 +1071,7 @@ object Parsers { syntaxErrorOrIncomplete("`*' expected"); t } case AT if location != Location.InPattern => - (t /: annotations()) ((t, annot) => Annotated(annot, t)) + (t /: annotations())(Annotated) case _ => val tpt = typeDependingOn(location) if (isWildcard(t) && location != Location.InPattern) { |