Skip to content

Struct literal syntax allows repeated fields #3486

Closed
@catamorphism

Description

@catamorphism

Right now, you can write:

T { foo: 1, foo: 2 }

if T is a struct with a foo field. (I haven't checked if this is only accepted if T has exactly two fields, but it's definitely accepted if so.) The typechecker should reject this because it duplicates a field.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions