mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Capture params in nested defs
This commit is contained in:
parent
c85c634387
commit
50887e6265
9 changed files with 35 additions and 7 deletions
|
@ -1569,6 +1569,9 @@ fn canonicalize_closure_body<'a>(
|
|||
// filter out functions that don't close over anything
|
||||
.filter(|s| !new_output.non_closures.contains(s))
|
||||
.filter(|s| !output.non_closures.contains(s))
|
||||
// module params are not captured by top-level defs, because they are passed in as arguments
|
||||
// nested defs, however, do capture them
|
||||
.filter(|s| scope.depth > 1 || !env.home_param_symbols.contains(s))
|
||||
.map(|s| (s, var_store.fresh()))
|
||||
.collect();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue