Skip to content
Playground(another site)

bynk.val.arity

Error Val[T] was given the wrong number of pin arguments.

Val[T] takes at most one argument, the pin: Val[Age] lets the compiler choose a value, Val[Age](20) fixes it. Val makes one value of one type, so a second argument has no meaning. Pass one pin or none.

Example

demo/ages.bynk
type Age = Int where InRange(0, 150)
// tests/ages.test.bynk
let a = Val[Age](20, 30) // ✗ two pins
let a = Val[Age](20) // ✓ one

In the Book

See also