Skip to content

Wrong deserialization for coproducts with empty lists #32

@vovapolu

Description

@vovapolu
import pbdirect._

sealed trait Foo

case class Foo1(li: List[Int])
case class Foo2(ll: List[Long])
import cats.instances.list._

println(Foo1(List.empty).toPB.toSeq)
println(Foo2(List.empty).toPB.toSeq)

// prints
// WrappedArray()
// WrappedArray()

So in general (a: A).toPb.pbTo[A] == a can be false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions