pickling icon indicating copy to clipboard operation
pickling copied to clipboard

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

Open cakoose opened this issue 11 years ago • 3 comments

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

  • Platform: Mac OS 10.9.4, Java 1.7.0_67, Scala 2.11.12
  • Built scala/pickling from the latest source (0.9.x branch, commit 61d9f198c21c573d4bf929d5eb682a16f20f719a)

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.

cakoose avatar Oct 02 '14 02:10 cakoose

I can reproduce this with Pickling 0.10.0.

eed3si9n avatar Feb 08 '15 09:02 eed3si9n

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

hilios avatar May 24 '16 17:05 hilios

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).

jvican avatar May 24 '16 20:05 jvican