scala / pickling

Fast, customizable, boilerplate-free pickling support for Scala
lampwww.epfl.ch/~hmiller/pickling
BSD 3-Clause "New" or "Revised" License
831 stars 79 forks source link

[WIP] Support for Scala 2.12 #438

Closed jodersky closed 6 years ago

jodersky commented 8 years ago

Mainly just copy over the sun.misc.Unsafe, as it is not made available through Scala concurrent anymore. Compilation is fine, however anonymous functions currently don't work as these are no longer built as Class$$anonfun$ classes (hence the WIP tag).

This is a continuation of the discussion in #388.

unoexperto commented 8 years ago

@jodersky How is it going ?

I tried compiling your branch with 2.12-M5 and get this

[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/generator/sourcegen.scala:7: type FastTypeTagMacros is not a member of package scala.pickling.tags
[error] private[pickling] trait SourceGenerator extends Macro with tags.FastTypeTagMacros {
[error]                                                                 ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/generator/sourcegen.scala:7: type FastTypeTagMacros is not a member of package scala.pickling.tags
[error] private[pickling] trait SourceGenerator extends Macro with tags.FastTypeTagMacros {
[error]                                                                 ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/generator/sourcegen.scala:337: not found: value typeKey
[error]          val skey = typeKey(stpe)
[error]                     ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/generator/sourcegen.scala:419: FastTypeTagMacros does not name a parent class of trait SourceGenerator
[error]     val createTagTree = super[FastTypeTagMacros].impl[T]
[error]                         ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/generator/sourcegen.scala:337: not found: value typeKey
[error]          val skey = typeKey(stpe)
[error]                     ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/generator/sourcegen.scala:419: FastTypeTagMacros does not name a parent class of trait SourceGenerator
[error]     val createTagTree = super[FastTypeTagMacros].impl[T]
[error]                         ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/tags/Compat.scala:11: not found: type FastTypeTagMacros
[error]     val bundle = new { val c: c0.type = c0 } with FastTypeTagMacros
[error]                                                   ^
[error] /home/expert/work/externals/pickling/core/src/main/scala/scala/pickling/tags/Compat.scala:11: not found: type FastTypeTagMacros
[error]     val bundle = new { val c: c0.type = c0 } with FastTypeTagMacros
[error]                                                   ^
jodersky commented 8 years ago

Hi @cppexpert, that looks very strange. As you can see in the diff, essentially all my changes consist of copying the unsafe code to scala pickling.

Could your build environment be dirty?

ekrich commented 7 years ago

I have submitted a PR as well - I also got rid of most of the deprecations but also removed 2.10 support. Refer to https://github.com/scala/pickling/pull/451 for more info.

jodersky commented 6 years ago

Superseded by #451