Closed
Description
This is follows on from #5423.
Example:
type t = {x: int, @optional y: string}
let v = {x: 3, y: "ab"}
let q = switch v {
| {x: 3, y: Some("ab")} => true
| _ => false
}
There's asymmetry between expressions and patterns.
Proposal: adopt for patterns the same convention used for expressions.
The example above now becomes:
let q = switch v {
| {x: 3, y: "ab"} => true
| _ => false
}
And for catch-all:
- Q: what would
| {y: _} =>
mean? A: it meansSome(_)
. - Q: what does
| {y : @optional _ }
mean? A: it means_
.
Metadata
Metadata
Assignees
Labels
No labels