Skip to content
Playground(another site)

bynk.suite.const_name_clash

Error A suite const has the name of a declaration or sum variant already in scope in the suite's cases.

A suite's cases see the target's own declarations and those of the commons it uses, and the suite's constants are used by bare name beside them. A suite constant with one of those names, or with that of a sum variant in scope, would silently change which value a mention reaches, so it is refused instead of shadowing. Rename it. A type clashing is bynk.suite.type_name_clash.

Example

demo/desk.bynk
const Limit: Int = 5
// tests/desk.test.bynk
const Limit: Int = 9 // ✗ the target already has a `Limit`
const Cap: Int = 9 // ✓ a name of its own

In the Book

See also

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