amnaredo / test

0 stars 0 forks source link

Error message when trying to serialize object of type Any #203

Open amnaredo opened 2 years ago

amnaredo commented 2 years ago

Thanks a lot for your great library!

μPickle can't serialize case classes that have a field of type Any. So this won't fly: case class FileInfo (name: String, content: Any)

It would be really nice if we could get a more informative error than this:

[error] C:\Users\me\Dev\Scala\my\app\js\src\main\scala\client\Client.scala:50: type mismatch; [error] found : upickle.default.Writer[(shared.FileInfo, shared.FileInfo)] [error] required: upickle.default.Aliases.W[(String, Any)] [error] (which expands to) upickle.default.Writer[(String, Any)] [error] val eventualResponse = Ajaxer[MyApi].postFile(fileInfo).call() [error] ^

I'm thinking something along the lines of:

case class FileInfo contains a field of type Any; μPickle can't serialize that

ID: 192 Original Author: mb720

amnaredo commented 2 years ago

Bug bankruptcy Original Author: lihaoyi

amnaredo commented 2 years ago

Sorry to hear.

Still, I had a great time using uPickle and for me it raised the bar of what I expect from web development.

Original Author: mb720