pickling
pickling copied to clipboard
exception during macro expansion: value Predef is not a package
steps
Use JDK8 and publish
.
$ java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Using sbt serialization 0.1.2, which uses Scala Pickling 0.10.1.
implicit val pickler: Pickler[RPDependencyOverrideLite] with Unpickler[RPDependencyOverrideLite] = PicklerUnpickler.generate[RPDependencyOverrideLite]
problem
The compilation results to the following error.
It doesn't always happen:
exception during macro expansion:
[error] scala.reflect.runtime.ReflectError: value Predef is not a package
[error] at scala.reflect.runtime.JavaMirrors$JavaMirror.scala$reflect$runtime$JavaMirrors$$makeScalaPackage(JavaMirrors.scala:912)
[error] at scala.reflect.runtime.JavaMirrors$class.missingHook(JavaMirrors.scala:1296)
[error] at scala.reflect.runtime.JavaUniverse.missingHook(JavaUniverse.scala:12)
[error] at scala.reflect.internal.Mirrors$RootsBase.universeMissingHook(Mirrors.scala:77)
[error] at scala.reflect.internal.Mirrors$RootsBase.missingHook(Mirrors.scala:79)
[error] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:48)
[error] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:61)
[error] at scala.reflect.internal.Mirrors$RootsBase.staticModuleOrClass(Mirrors.scala:72)
[error] at scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:161)
[error] at scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:21)
[error] at scala.pickling.FastTypeTag$$typecreator9$1.apply(FastTags.scala:94)
[error] at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe$lzycompute(TypeTags.scala:231)
[error] at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe(TypeTags.scala:231)
[error] at scala.reflect.api.TypeTags$class.typeOf(TypeTags.scala:335)
[error] at scala.reflect.api.Universe.typeOf(Universe.scala:59)
[error] at scala.pickling.FastTypeTag$.stdTag(FastTags.scala:79)
[error] at scala.pickling.FastTypeTag$.<init>(FastTags.scala:94)
[error] at scala.pickling.FastTypeTag$.<clinit>(FastTags.scala)
[error] at scala.pickling.UnpickleMacros$class.createNullDispatch(Macros.scala:772)
[error] at scala.pickling.Compat$$anon$1.createNullDispatch(Compat.scala:31)
[error] at scala.pickling.UnpicklerMacros$class.unpickleLogic(Macros.scala:606)
[error] at scala.pickling.Compat$$anon$1.unpickleLogic(Compat.scala:31)
[error] at scala.pickling.PicklerUnpicklerMacros$$anonfun$impl$1.apply(Macros.scala:48)
[error] at scala.pickling.PicklerUnpicklerMacros$$anonfun$impl$1.apply(Macros.scala:43)
[error] at scala.pickling.Macro.preferringAlternativeImplicits(Tools.scala:374)
[error] at scala.pickling.PicklerUnpicklerMacros$class.impl(Macros.scala:43)
[error] at scala.pickling.Compat$$anon$1.impl(Compat.scala:31)
[error] at scala.pickling.Compat$.PicklerUnpicklerMacros_impl(Compat.scala:32)
[error] implicit val pickler: Pickler[RPDependencyOverrideLite] with Unpickler[RPDependencyOverrideLite] = PicklerUnpickler.generate[RPDependencyOverrideLite]
[error]
expectations
No errors.
note
Simultaneously I see that doc
succeeds, so it could be caused by the interaction between them.
Another exception during macro expansion. Same spot in code.
exception during macro expansion:
[error] java.lang.RuntimeException: malformed Scala signature of Short at 45; bad type tag: 6
[error] at scala.reflect.internal.pickling.UnPickler$Scan.errorBadSignature(UnPickler.scala:833)
[error] at scala.reflect.internal.pickling.UnPickler$Scan.noSuchTypeTag(UnPickler.scala:402)
[error] at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:397)
[error] at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$34.apply(UnPickler.scala:855)
[error] at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$34.apply(UnPickler.scala:855)
[error] at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
[error] at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:855)
[error] at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.load(UnPickler.scala:863)
[error] at scala.reflect.internal.Symbols$Symbol.typeParams(Symbols.scala:1491)
[error] at scala.reflect.internal.Types$NoArgsTypeRef.typeParams(Types.scala:2144)
[error] at scala.reflect.internal.Types$NoArgsTypeRef.isHigherKinded(Types.scala:2143)
[error] at scala.reflect.internal.Types$NoArgsTypeRef.normalizeImpl(Types.scala:2177)
[error] at scala.reflect.internal.Types$TypeRef.normalize(Types.scala:2383)
[error] at scala.reflect.internal.Types$TypeRef.normalize(Types.scala:2341)
[error] at scala.pickling.internal.package$RichTypeFIXME.key(package.scala:77)
[error] at scala.pickling.FastTypeTag$.stdTag(FastTags.scala:79)
[error] at scala.pickling.FastTypeTag$.<init>(FastTags.scala:83)
[error] at scala.pickling.FastTypeTag$.<clinit>(FastTags.scala)
[error] at scala.pickling.UnpickleMacros$class.createNullDispatch(Macros.scala:772)
[error] at scala.pickling.Compat$$anon$1.createNullDispatch(Compat.scala:31)
[error] at scala.pickling.UnpicklerMacros$class.unpickleLogic(Macros.scala:606)
[error] at scala.pickling.Compat$$anon$1.unpickleLogic(Compat.scala:31)
[error] at scala.pickling.PicklerUnpicklerMacros$$anonfun$impl$1.apply(Macros.scala:48)
[error] at scala.pickling.PicklerUnpicklerMacros$$anonfun$impl$1.apply(Macros.scala:43)
[error] at scala.pickling.Macro.preferringAlternativeImplicits(Tools.scala:374)
[error] at scala.pickling.PicklerUnpicklerMacros$class.impl(Macros.scala:43)
[error] at scala.pickling.Compat$$anon$1.impl(Compat.scala:31)
[error] at scala.pickling.Compat$.PicklerUnpicklerMacros_impl(Compat.scala:32)
[error] implicit val pickler: Pickler[RPDependencyOverrideLite] with Unpickler[RPDependencyOverrideLite] = PicklerUnpickler.generate[RPDependencyOverrideLite]
Appears to be some kind of race condition relating to pulling the type in FastTypeTag... May even be a compiler bug.