Skip to content
Playground(another site)

bynk.suite.fn_method

Error A suite helper fn is a method (fn Type.name); suite helpers are free functions.

A suite helper is a plain function its cases call by name, so it is a free fn, not a method (fn Type.name). A method belongs to its type: declare it in the target or in a commons. In a suite, take the value as an ordinary parameter.

Example

demo/desk.bynk
type Count = Int where NonNegative
// tests/desk.test.bynk
fn Count.bump(self) -> Int { 1 } // ✗ a method
fn bump(count: Count) -> Int { 1 } // ✓ a free function

In the Book

See also

  • The grammar rule it governs: fn_decl.
  • Every code in its category, Suites and cases, on the diagnostic index.
  • bynk explain bynk.suite.fn_method shows the same from the installed toolchain, without a network.