mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +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,
|
||||
);
|
||||
|
||||
// an optional field binds the symbol!
|
||||
output.references.bound_symbols.insert(symbol);
|
||||
|
||||
output.union(expr_output);
|
||||
|
||||
destructs.push(Located {
|
||||
|
|
|
@ -201,8 +201,8 @@ fn solve(
|
|||
constraint: &Constraint,
|
||||
) -> State {
|
||||
match constraint {
|
||||
// True => state,
|
||||
True => {
|
||||
dbg!(&env.vars_by_symbol);
|
||||
state
|
||||
.vars_by_symbol
|
||||
.extend(env.vars_by_symbol.iter().map(|(x, y)| (*x, *y)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue