Closed
Description
Colons will allow specifying the types of pattern elements (let x: int = 6
), but are also used as separators between field names and sub-patterns in record patterns ({x: ?binding}
). Since we allow the sub-pattern to be omitted ({x}
is interpreted as {x: ?x}
) this introduces an ambiguity—the parser can't tell whether a colon in a record pattern indicates a sub-pattern or a type.
Possible solutions include using another character for type assertions or simply specifying that the patterns has to be written out in full if you want to type it (resulting in the rather ugly {x:?x:int}
).
Metadata
Metadata
Assignees
Labels
No labels