Skip to content
Playground(another site)

bynk.val.unsupported_kind

Error Val[T] cannot fabricate a value for this kind of type.

Val[T] fabricates a value from a type declaration: a refinement, a sum, a record or an opaque type. A built-in type such as Int or String, a List or a function type has no declaration to draw from, so Val refuses it. Write the value, 20, or declare a type for it, which Val can then fabricate.

Example

type Age = Int where InRange(0, 150)
let n = Val[Int] // ✗ a built-in type
let a = Val[Age] // ✓ a declared type

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.unsupported_kind shows the same from the installed toolchain, without a network.