Skip to content
Playground(another site)

bynk.suite.fn_name_clash

Error A suite helper fn has the name of a declaration already in scope in the suite's cases.

A suite helper is called by bare name from the suite's cases, which also see the target's declarations (services and agents included) and those of the commons it uses. A helper with one of those names would silently change which function a call reaches, so it is refused instead of shadowing. A fixture of the suite counts too, and deps and names beginning __ are reserved for the runner. Rename the helper. A type or constant clashing is bynk.suite.type_name_clash or bynk.suite.const_name_clash.

Example

demo/desk.bynk
fn double(n: Int) -> Int { n * 2 }
// tests/desk.test.bynk
fn double(n: Int) -> Int { n * 3 } // ✗ the target has a `double`
fn triple(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.fn_name_clash shows the same from the installed toolchain, without a network.