Skip to content
Playground(another site)

bynk.resolve.duplicate_type

Error Two types share a name.

A unit declares two types, or a type and an event, with the same name. A unit's top-level declarations share one scope in the emitted module, so a name can mean only one thing, and a type name appears in signatures and constructors with no way to say which declaration is meant. Rename one of them, or remove the repeated declaration. The check spans all of the unit's files, so the second declaration can be in a different file.

Example

type Money = Int
type Money = String // ✗ `Money` is already declared
type Money = Int
type Label = String // ✓ distinct names

In the Book

See also

  • The grammar rule it governs: type_decl.
  • Every code in its category, Resolution, on the diagnostic index.
  • bynk explain bynk.resolve.duplicate_type shows the same from the installed toolchain, without a network.