Skip to content
Playground(another site)

bynk.val.unknown_type

Error Val[T] names a type that does not resolve.

Val[T] fabricates a value of the type it names, so the name must resolve to a type the suite can see. A misspelt name stops here, before anything else about the value can be checked. Fix the spelling, or declare the type in the target unit or the suite. The same code covers a for all binder whose type does not resolve.

Example

demo/ages.bynk
type Age = Int where InRange(0, 150)
// tests/ages.test.bynk
let a = Val[Agee] // ✗ no such type
let a = Val[Age] // ✓ the 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.unknown_type shows the same from the installed toolchain, without a network.