S0036: duplicate type definition
Generated from rellum-diagnostics/src/db.rs.
Explanation
A module may define a type name only once. Records, enums, and generic type templates share the same type namespace, so a duplicate name would make later construction, annotation, and pattern checks ambiguous.
Common causes
- declaring a record and enum with the same name
- declaring the same type name twice in one module
- copying a type definition and forgetting to rename it
Canonical fixes
- give each type definition a unique name
Before:
type Packet = { id: Int }
type Packet = { bytes: [Int] }
After:
type Packet = { id: Int }
type PacketBytes = { bytes: [Int] }
Code example
type Packet = { id: Int }
type Packet = { bytes: [Int] }