Skip to content
Playground(another site)

bynk.val.pin_unsupported

Error A pin was given for a type kind that does not support pinning.

A pinned Val[T](lit) is accepted only for a refined type, where the literal is checked against the refinement. A sum, record or opaque type takes no pin, so one is refused. Use bare Val[T], which builds the first variant, or every field, itself, or construct the value directly with a variant or a record literal. A pin that is not a literal at all is bynk.val.pin_not_literal.

Example

tests/demo.test.bynk
let s = Val[Status](1) // ✗ `Status` is a sum
let s = Val[Status] // ✓ bare `Val` picks the first variant

In the Book

See also

  • The grammar rule it governs: val_expr.
  • Every code in its category, Value fabrication, on the diagnostic index.
  • bynk explain bynk.val.pin_unsupported shows the same from the installed toolchain, without a network.