summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/pickling
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-04-14 10:45:17 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-04-14 14:04:42 +0200
commit540535f71e2b4141db9294b8c2b053319a216084 (patch)
tree1a85417cb053aca7662981f65474fd54a4affd66 /src/reflect/scala/reflect/internal/pickling
parent470a51285b686b0f0e0149d1741f76b03ecab310 (diff)
downloadscala-540535f71e2b4141db9294b8c2b053319a216084.tar.gz
scala-540535f71e2b4141db9294b8c2b053319a216084.tar.bz2
scala-540535f71e2b4141db9294b8c2b053319a216084.zip
SI-8497 Fix regression in pickling of AnnotatedTypes
Fixes an inconsistency introduced in these two spots: https://github.com/scala/scala/pull/3033/files#diff-6ce1a17ebee31068f41c36a8a2b3bc9aR79 https://github.com/scala/scala/pull/3033/files#diff-c455cb229f5227b1bcaa1544478fe3acR452 The bug shows up when pickling then unpickling an AnnotatedType that has only non-static annotations.
Diffstat (limited to 'src/reflect/scala/reflect/internal/pickling')
-rw-r--r--src/reflect/scala/reflect/internal/pickling/Translations.scala31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/reflect/scala/reflect/internal/pickling/Translations.scala b/src/reflect/scala/reflect/internal/pickling/Translations.scala
index e56cf796cb..d924cb3a0c 100644
--- a/src/reflect/scala/reflect/internal/pickling/Translations.scala
+++ b/src/reflect/scala/reflect/internal/pickling/Translations.scala
@@ -62,21 +62,22 @@ trait Translations {
}
def picklerTag(tpe: Type): Int = tpe match {
- case NoType => NOtpe
- case NoPrefix => NOPREFIXtpe
- case _: ThisType => THIStpe
- case _: SingleType => SINGLEtpe
- case _: SuperType => SUPERtpe
- case _: ConstantType => CONSTANTtpe
- case _: TypeBounds => TYPEBOUNDStpe
- case _: TypeRef => TYPEREFtpe
- case _: RefinedType => REFINEDtpe
- case _: ClassInfoType => CLASSINFOtpe
- case _: MethodType => METHODtpe
- case _: PolyType => POLYtpe
- case _: NullaryMethodType => POLYtpe // bad juju, distinct ints are not at a premium!
- case _: ExistentialType => EXISTENTIALtpe
- case _: AnnotatedType => ANNOTATEDtpe
+ case NoType => NOtpe
+ case NoPrefix => NOPREFIXtpe
+ case _: ThisType => THIStpe
+ case _: SingleType => SINGLEtpe
+ case _: SuperType => SUPERtpe
+ case _: ConstantType => CONSTANTtpe
+ case _: TypeBounds => TYPEBOUNDStpe
+ case _: TypeRef => TYPEREFtpe
+ case _: RefinedType => REFINEDtpe
+ case _: ClassInfoType => CLASSINFOtpe
+ case _: MethodType => METHODtpe
+ case _: PolyType => POLYtpe
+ case _: NullaryMethodType => POLYtpe // bad juju, distinct ints are not at a premium!
+ case _: ExistentialType => EXISTENTIALtpe
+ case StaticallyAnnotatedType(_, _) => ANNOTATEDtpe
+ case _: AnnotatedType => picklerTag(tpe.underlying)
}
def picklerSubTag(tree: Tree): Int = tree match {