Skip to content

Polymorphic variants with payloads don't seem to be supported by the PPX #160

@tsnobip

Description

@tsnobip
@schema
type error = [
  | #BadRequest(string)
]

generates the following error:

  This has type:
    S.t<
  ([>
    | #BadRequest
  ] as 'a),
>
  But it's expected to have type: S.t<error>
  
  The incompatible parts:
    'a vs
    error (defined as
      [
  | #BadRequest(string)
])
  
  Both polymorphic variants have the constructor #BadRequest, but their payload types are incompatible.
  Make sure the payload types for #BadRequest match exactly in both polymorphic variants.

Is this a known limitation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions