Skip to content

Commit b7aae3f

Browse files
committed
Swap order of arguments in annotations for Tasty
1 parent e7fdb41 commit b7aae3f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Standard-Section: "ASTs" TopLevelStat*
131131
APPLIEDtype Length tycon_Type arg_Type*
132132
TYPEBOUNDS Length low_Type high_Type
133133
TYPEALIAS Length alias_Type (COVARIANT | CONTRAVARIANT)?
134-
ANNOTATED Length fullAnnotation_Term underlying_Type
134+
ANNOTATED Length underlying_Type fullAnnotation_Term
135135
ANDtype Length left_Type right_Type
136136
ORtype Length left_Type right_Type
137137
BIND Length boundName_NameRef bounds_Type

src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class TreePickler(pickler: TastyPickler) {
239239
withLength { pickleType(tpe.lo, richTypes); pickleType(tpe.hi, richTypes) }
240240
case tpe: AnnotatedType =>
241241
writeByte(ANNOTATED)
242-
withLength { pickleTree(tpe.annot.tree); pickleType(tpe.tpe, richTypes) }
242+
withLength { pickleType(tpe.tpe, richTypes); pickleTree(tpe.annot.tree) }
243243
case tpe: AndOrType =>
244244
writeByte(if (tpe.isAnd) ANDtype else ORtype)
245245
withLength { pickleType(tpe.tp1, richTypes); pickleType(tpe.tp2, richTypes) }

src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
199199
else 0
200200
TypeAlias(alias, variance)
201201
case ANNOTATED =>
202-
val annot = Annotation(readTerm())
203-
AnnotatedType(readType(), annot)
202+
AnnotatedType(readType(), Annotation(readTerm()))
204203
case ANDtype =>
205204
AndType(readType(), readType())
206205
case ORtype =>

0 commit comments

Comments
 (0)