mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
optional record fields in patterns are bound
This commit is contained in:
parent
e656363cc0
commit
9b83c3ad58
2 changed files with 4 additions and 1 deletions
|
@ -326,6 +326,9 @@ pub fn canonicalize_pattern<'a>(
|
||||||
&loc_default.value,
|
&loc_default.value,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// an optional field binds the symbol!
|
||||||
|
output.references.bound_symbols.insert(symbol);
|
||||||
|
|
||||||
output.union(expr_output);
|
output.union(expr_output);
|
||||||
|
|
||||||
destructs.push(Located {
|
destructs.push(Located {
|
||||||
|
|
|
@ -201,8 +201,8 @@ fn solve(
|
||||||
constraint: &Constraint,
|
constraint: &Constraint,
|
||||||
) -> State {
|
) -> State {
|
||||||
match constraint {
|
match constraint {
|
||||||
// True => state,
|
|
||||||
True => {
|
True => {
|
||||||
|
dbg!(&env.vars_by_symbol);
|
||||||
state
|
state
|
||||||
.vars_by_symbol
|
.vars_by_symbol
|
||||||
.extend(env.vars_by_symbol.iter().map(|(x, y)| (*x, *y)));
|
.extend(env.vars_by_symbol.iter().map(|(x, y)| (*x, *y)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue