aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/TypeAssigner.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-11-22 17:47:57 +0100
committerMartin Odersky <odersky@gmail.com>2015-11-22 18:03:17 +0100
commite7fdb416006cfa4091b90935c74b5602adb5f68e (patch)
tree1070807d8eb3d3b37cc6047f5362543557bbfec8 /src/dotty/tools/dotc/typer/TypeAssigner.scala
parentdce7053f3a6b859733253edcc82ad42b6ea3ed73 (diff)
downloaddotty-e7fdb416006cfa4091b90935c74b5602adb5f68e.tar.gz
dotty-e7fdb416006cfa4091b90935c74b5602adb5f68e.tar.bz2
dotty-e7fdb416006cfa4091b90935c74b5602adb5f68e.zip
Swap order of arguments in annotations
The fact that the annotation comes first is weird, because when I write an annotated type it's <type> @<annotation>. Also, annotated types are like RefinedTypes in that they derive from a parent type. And in RefinedTypes the parent comes first. So swapping the arguments improves consistency.
Diffstat (limited to 'src/dotty/tools/dotc/typer/TypeAssigner.scala')
-rw-r--r--src/dotty/tools/dotc/typer/TypeAssigner.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala
index f7cda1ef6..30d6baf8a 100644
--- a/src/dotty/tools/dotc/typer/TypeAssigner.scala
+++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -404,7 +404,7 @@ trait TypeAssigner {
tree.withType(sym.nonMemberTermRef)
def assignType(tree: untpd.Annotated, annot: Tree, arg: Tree)(implicit ctx: Context) =
- tree.withType(AnnotatedType(Annotation(annot), arg.tpe))
+ tree.withType(AnnotatedType(arg.tpe, Annotation(annot)))
def assignType(tree: untpd.PackageDef, pid: Tree)(implicit ctx: Context) =
tree.withType(pid.symbol.valRef)