mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
Don't check for unused defs too late
This commit is contained in:
parent
ea455e7394
commit
415738f867
@ -1104,9 +1104,6 @@ pub fn can_defs_with_return<'a>(
|
||||
canonicalize_expr(env, var_store, &mut scope, loc_ret.region, &loc_ret.value);
|
||||
let (can_defs, mut output) = sort_can_defs(env, unsorted, output);
|
||||
|
||||
output.rigids = output.rigids.union(defs_output.rigids);
|
||||
output.references = output.references.union(defs_output.references);
|
||||
|
||||
// Now that we've collected all the references, check to see if any of the new idents
|
||||
// we defined went unused by the return expression. If any were unused, report it.
|
||||
for (symbol, region) in symbols_introduced {
|
||||
@ -1115,6 +1112,9 @@ pub fn can_defs_with_return<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
output.rigids = output.rigids.union(defs_output.rigids);
|
||||
output.references = output.references.union(defs_output.references);
|
||||
|
||||
match can_defs {
|
||||
Ok(decls) => {
|
||||
let mut loc_expr: Located<Expr> = ret_expr;
|
||||
|
Loading…
Reference in New Issue
Block a user