diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-04-21 20:55:01 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-04-21 20:55:01 +0200 |
commit | d573db8006a0de06c8e1a5d960f74d8270cb1ab6 (patch) | |
tree | ecd5d63002628504fb6306fd111e3211033434b7 | |
parent | 0c2614e862b0a9eadca6f2c734cef8c876908f8d (diff) | |
parent | 540535f71e2b4141db9294b8c2b053319a216084 (diff) | |
download | scala-d573db8006a0de06c8e1a5d960f74d8270cb1ab6.tar.gz scala-d573db8006a0de06c8e1a5d960f74d8270cb1ab6.tar.bz2 scala-d573db8006a0de06c8e1a5d960f74d8270cb1ab6.zip |
Merge pull request #3682 from retronym/ticket/8497
SI-8497 Fix regression in pickling of AnnotatedTypes
-rw-r--r-- | src/reflect/scala/reflect/internal/pickling/Translations.scala | 31 | ||||
-rw-r--r-- | test/files/pos/t8497/A_1.scala | 13 | ||||
-rw-r--r-- | test/files/pos/t8497/B_2.scala | 1 |
3 files changed, 30 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 { diff --git a/test/files/pos/t8497/A_1.scala b/test/files/pos/t8497/A_1.scala new file mode 100644 index 0000000000..6a76b0ee99 --- /dev/null +++ b/test/files/pos/t8497/A_1.scala @@ -0,0 +1,13 @@ +package p { + object Crash { + def e(s: (String @java.lang.Deprecated)): Unit = () + def f(s: (String @nonStatic)): Unit = () + } + object Ok { + def g(s: (String @nonStatic @static)): Unit = () + def h(s: (String @static)): Unit = () + } +} + +class nonStatic extends scala.annotation.Annotation +class static extends scala.annotation.StaticAnnotation diff --git a/test/files/pos/t8497/B_2.scala b/test/files/pos/t8497/B_2.scala new file mode 100644 index 0000000000..efe2edf2c3 --- /dev/null +++ b/test/files/pos/t8497/B_2.scala @@ -0,0 +1 @@ +package p { object Test { Crash } } |