Skip to content
Playground(another site)

bynk.suite.type_name_clash

Error A suite type, or a variant of one, has the name of a declaration or sum variant already in scope in the suite's cases, or of another suite item.

A suite's cases see the target's own declarations and those of the commons it uses, and the suite's types are used by bare name beside them. A suite type with one of those names would silently change which type a mention reaches, so it is refused instead of shadowing. The same goes for a variant of a suite's own sum type. Rename it. A constant clashing is bynk.suite.const_name_clash.

Example

demo/desk.bynk
type Item = { sku: String }
// tests/desk.test.bynk
type Item = { n: Int } // ✗ the target already has an `Item`
type Counted = { n: Int } // ✓ a name of its own

In the Book

See also

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