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

Doesn't work when there's a package named "scala". #202

Open cakoose opened 10 years ago

cakoose commented 10 years ago

Reduced test case:

steps (0.10.0)

package bug

case class Point(x: Int, y: Int)

object Test {
  import _root_.scala.pickling._, Defaults._
  import binary._

  def serialize(obj: Point): Array[Byte] = obj.pickle.value
    // ERROR: object pickling is not a member of package bug.scala
}

// If you comment this package out, compilation succeeds.
package scala {
  case class Hello(n: String)
}

problem

[error] pickling/sandbox/scala/test.scala:9: Cannot generate a pickler for bug.Point. Recompile with -Xlog-implicits for details
[error]   def serialize(obj: Point): Array[Byte] = obj.pickle.value
[error]                                                ^
[error] one error found
[error] (sandbox/compile:compile) Compilation failed

notes

I tried modifying the scala/pickling source and changing a bunch of scala.whatever references to _root_.scala.whatever. I think this got me further, but I just hit a different error message.

eed3si9n commented 9 years ago

I can reproduce this with Pickling 0.10.0.

hilios commented 8 years ago

Experiencing this with a Play app, 1 year after no way around it?

jvican commented 8 years ago

Not in 0.10.0, which has been abandoned in favor of the upcoming 0.11.x, which will be released soon (probably mid-June). This looks like a hygiene problem and, in that case, it's being completely fixed in the new version.

There's no official release of it, but if it's urgent you can publish it locally and use this as release notes (note they're not completed and will not until the official release).