mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Change guard to DestructType
This commit is contained in:
parent
85f51ef39d
commit
8b53ec15fe
4 changed files with 69 additions and 16 deletions
|
@ -941,7 +941,7 @@ fn canonicalize_field<'a>(
|
|||
|
||||
match field {
|
||||
// Both a label and a value, e.g. `{ name: "blah" }`
|
||||
LabeledValue(label, _, loc_expr) => {
|
||||
RequiredValue(label, _, loc_expr) => {
|
||||
let field_var = var_store.fresh();
|
||||
let (loc_can_expr, output) =
|
||||
canonicalize_expr(env, var_store, scope, loc_expr.region, &loc_expr.value);
|
||||
|
@ -954,6 +954,10 @@ fn canonicalize_field<'a>(
|
|||
)
|
||||
}
|
||||
|
||||
OptionalValue(_, _, _) => {
|
||||
todo!("TODO gracefully handle an optional field being used in an Expr");
|
||||
}
|
||||
|
||||
// A label with no value, e.g. `{ name }` (this is sugar for { name: name })
|
||||
LabelOnly(_) => {
|
||||
panic!("Somehow a LabelOnly record field was not desugared!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue