amnaredo / test

0 stars 0 forks source link

Case objects unsupported #104

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

uPickle cannot deal with case objects as shown in the following code:

trait Type
object Type {
  case object A extends Type
  case object B extends Type
}

upickle.read[Type]("") // Error: uPickle does not know how to read [Type]s; define an implicit Reader[Type] to teach it how

Edit: When the trait is sealed, the above compiles without problems. Could the macro issue an error in such cases?

ID: 57 Original Author: tindzk

amnaredo commented 3 years ago

Needs to be sealed. Yeah, it should report a better error message. In general, error reporting could use a lot of work =/ Let's leave this open until we fix it

Original Author: lihaoyi

amnaredo commented 3 years ago

Closed by https://github.com/lihaoyi/upickle/pull/58, thanks!

Original Author: lihaoyi