amnaredo / test

0 stars 0 forks source link

Reading and writing case classes that use a Seq[UUID] fail to compile #130

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

This code:

import upickle.default._
import java.util.UUID

case class Example(ids: Seq[UUID])

val myExample = Example(Seq(UUID.randomUUID()))
write(myExample)

fails to compile with the following error:

error: [error] The referenced trait [[Seq]] must be sealed.
      write(myExample)

Using read fails similarly. There's no issue with writing a Seq[UUID] not in a case class, though.

~~Edit: My "workaround" was actually using 0.2.8. The error still applies in 0.3.0.~~

ID: 94 Original Author: Technius

amnaredo commented 3 years ago

This appears to be a regression in scala 2.11.x, and I haven't managed to figure it out. For now a workaround is import upickle.default.write and avoid importing all the unnecessary names from the upickle.default namespace

Original Author: lihaoyi

amnaredo commented 3 years ago

9d2b6b81de20e3dcda65f702ff33d85d7122c3f2

Original Author: lihaoyi