Skip to content
Playground(another site)

bynk.suite.duplicate_fn

Error A suite declares two helper fns of the same name.

A case calls a suite helper by its bare name, so two helpers of one suite with one name would leave the call ambiguous. Give each a distinct name; the error is on the repeat. The same holds for a suite's types and constants: see bynk.suite.duplicate_type and bynk.suite.duplicate_const.

Example

tests/desk.test.bynk
fn twice(n: Int) -> Int { n * 2 }
fn twice(n: Int) -> Int { n + n } // ✗ `twice` again
fn thrice(n: Int) -> Int { n * 3 } // ✓

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