Check for infinite types of introduced variables before bodies

This commit is contained in:
Ayaz Hafiz 2022-08-09 14:09:19 -07:00
parent 4cb5de4428
commit d22bd274fd
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 4 additions and 15 deletions

View file

@ -713,12 +713,13 @@ fn solve(
new_env.insert_symbol_var_if_vacant(*symbol, loc_var.value);
}
stack.push(Work::CheckForInfiniteTypes(local_def_vars));
stack.push(Work::Constraint {
env: arena.alloc(new_env),
rank,
constraint: ret_constraint,
});
// Check for infinite types first
stack.push(Work::CheckForInfiniteTypes(local_def_vars));
continue;
}
@ -831,12 +832,13 @@ fn solve(
// Now solve the body, using the new vars_by_symbol which includes
// the assignments' name-to-variable mappings.
stack.push(Work::CheckForInfiniteTypes(local_def_vars));
stack.push(Work::Constraint {
env: arena.alloc(new_env),
rank,
constraint: ret_constraint,
});
// Check for infinite types first
stack.push(Work::CheckForInfiniteTypes(local_def_vars));
state = state_for_ret_con;