S0037: duplicate name in type declaration
Generated from rellum-diagnostics/src/db.rs.
Explanation
Type declarations require unique names for type parameters, record fields, enum variants, and enum variant payload fields. Duplicate names would make construction, field access, and generic substitution ambiguous.
Common causes
- declaring the same type parameter twice
- declaring the same record field twice
- declaring duplicate enum variants or duplicate fields inside a variant
Canonical fixes
- rename or remove the duplicate declaration
Before:
type Point = { x: Int, x: Int }
After:
type Point = { x: Int, y: Int }
- use distinct type parameter names
Before:
type Pair[T, T] = { first: T, second: T }
After:
type Pair[T, U] = { first: T, second: U }
Code example
type Point = { x: Int, x: Int }