mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Record references in can/expr before evaluating to runtime error
This commit is contained in:
parent
6f9097da56
commit
767a348812
2 changed files with 42 additions and 4 deletions
|
@ -349,6 +349,10 @@ pub fn canonicalize_expr<'a>(
|
|||
// Default: We're not tail-calling a symbol (by name), we're tail-calling a function value.
|
||||
output.tail_call = None;
|
||||
|
||||
for arg_out in outputs {
|
||||
output.references = output.references.union(arg_out.references);
|
||||
}
|
||||
|
||||
let expr = match fn_expr.value {
|
||||
Var(symbol) => {
|
||||
output.references.calls.insert(symbol);
|
||||
|
@ -400,10 +404,6 @@ pub fn canonicalize_expr<'a>(
|
|||
}
|
||||
};
|
||||
|
||||
for arg_out in outputs {
|
||||
output.references = output.references.union(arg_out.references);
|
||||
}
|
||||
|
||||
(expr, output)
|
||||
}
|
||||
ast::Expr::Var { module_name, ident } => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue