Skip to content
Playground(another site)

bynk.suite.duplicate_const

Error A suite declares two consts of the same name, or a const with the name of one of its types.

A suite's constants are used by bare name in its cases, so a suite declares each name once: a second const Limit would leave Limit meaning two values. A const named like one of the suite's types counts as a repeat too. Rename one. The same holds for a suite's types, as bynk.suite.duplicate_type, and for helper functions, as bynk.suite.duplicate_fn.

Example

const Limit: Int = 5
const Limit: Int = 9 // ✗ `Limit` again
const Cap: Int = 9 // ✓ a name each

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