You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 20, 2019. It is now read-only.
When testing pickling-0.8 with case class serialization, I got an error:
Error: could not find implicit value for parameter e: scala.pickling.FastTypeTag[Person]
I managed to do some workaround to get rid of it, but I am not sure it's a wanted feature.
Here are two code snippets will help to reproduce the error:
Snippet 1:
objectTestextendsApp {
importscala.pickling._importjson._caseclassPerson(name: String, age: Int) // case class defined out of func test()deftest() = {
valres=Person("Hao", 10).pickle.value
println(res)
}
test
}
objectTestextendsApp {
importscala.pickling._importjson._deftest() = {
caseclassPerson(name: String, age: Int) // case class defined in func testvalres=Person("Hao", 10).pickle.value
println(res)
}
test
}
This code resulted in an error:
[error] /home/invoker/workspace/scalacode/sbt-example-pickling/Test.scala:7: could not find implicit value for parameter e: scala.pickling.FastTypeTag[Person]
[error] valres=Person("Hao", 10).pickle.value
[error] ^
[error] one error found
I can not understand why the position of case class definition matters. At compile time, the implicit parameter value is erased ? Does it do with the scala Macro feature ? Could someone show me any deep insights ? Highly appreciate that.
Hao
The text was updated successfully, but these errors were encountered:
invkrh
changed the title
Error: could not find implicit value for parameter e: scala.pickling.FastTypeTag
Error: could not find implicit value for parameter e: scala.pickling.FastTypeTag, source code and workaround attached
Aug 11, 2014
invkrh
changed the title
Error: could not find implicit value for parameter e: scala.pickling.FastTypeTag, source code and workaround attached
Error: could not find implicit value for parameter e: scala.pickling.FastTypeTag
Aug 11, 2014
When testing pickling-0.8 with case class serialization, I got an error:
I managed to do some workaround to get rid of it, but I am not sure it's a wanted feature.
Here are two code snippets will help to reproduce the error:
Snippet 1:
This code is good and resulted in :
Snippet 2:
This code resulted in an error:
I can not understand why the position of case class definition matters. At compile time, the implicit parameter value is erased ? Does it do with the scala Macro feature ? Could someone show me any deep insights ? Highly appreciate that.
Hao
The text was updated successfully, but these errors were encountered: