bynk.resolve.duplicate_field_init
Error A record construction initialises a field twice.
A record literal gives each field one value. A field set twice leaves it unclear which value is meant, and is nearly always a pasted line or a misspelt name for the field that was meant. Remove the repeat, or correct the name. A field declared twice in the type is bynk.resolve.duplicate_field; a field left out of the literal is bynk.resolve.missing_field.
Example
type Point = { x: Int, y: Int }
fn origin() -> Point { Point { x: 0, y: 0, y: 1 } } // ✗ `y` set twice
fn origin() -> Point { Point { x: 0, y: 0 } } // ✓ each field onceIn the Book
See also
- The grammar rule it governs:
record_construction. - Every code in its category, Resolution, on the diagnostic index.
bynk explain bynk.resolve.duplicate_field_initshows the same from the installed toolchain, without a network.