From 540535f71e2b4141db9294b8c2b053319a216084 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 14 Apr 2014 10:45:17 +0200 Subject: 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. --- .../reflect/internal/pickling/Translations.scala | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3