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 typelet a = Val[Age] // ✓ a declared typeIn the Book
- Testing › Val[T] — value fabrication
- Testing › @example — a value for a pattern
- Testing
- Write tests, stub collaborators, and pin a `Val[T]`
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_kindshows the same from the installed toolchain, without a network.