Skip to content
Playground(another site)

bynk.types.embeds_unknown_variant

Error An embeds … as V clause names a variant the sum does not declare.

embeds E as V lets ? wrap an E error in the variant V of the same sum, so V must be one of that sum's variants. Here it names none, usually a misspelling. Correct the name, or add the variant it should wrap into.

Example

type OrderError =
| Payment(reason: PayError)
embeds PayError as Pay // ✗ no variant `Pay`
type OrderError =
| Payment(reason: PayError)
embeds PayError as Payment // ✓

In the Book

See also

  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.embeds_unknown_variant shows the same from the installed toolchain, without a network.