Skip to content

Support Mirror.Sum for union types #21

Description

@bilal-fazlani
type Color = "Brown" | "White" | "Yellow" | "Black"
given Encoder[Color] = Encoder.derived
inline def derived[T](using gen: K0.Generic[T]): Encoder[T] =
  gen.derive(product, coproduct)
[error] 19 |  given Encoder[Color] = Encoder.derived
[error]    |                                        ^
[error]    |     no implicit argument of type shapeless3.deriving.K0.Generic[
[error]    |       (("Brown" : String) | ("White" : String) | ("Yellow" : String) |
[error]    |         ("Black" : String)
[error]    |       )
[error]    |     ] was found for parameter gen of method derived in object Encoder

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions