@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?