Skip to content

The Solo instance is incorrect #1119

Open
@Qqwy

Description

Solo is the canonical 1-element tuple type.
However, the implementation added in PR #891 treat it as any other normal 1-element type, which is incorrect.

This becomes problematic when you have code that wants to seriaize/deserialize generically over tuples of various arities:

  • (10, 20, 30) <-> "[10, 20, 30]"
  • (10, 20) <-> "[10, 20]"
  • Solo 10 <-> "10" ❗❗❗
  • () <-> "[]"

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions