Only assert that rigids are introduced at given rank behind flag

Closes #2489
This commit is contained in:
Ayaz Hafiz 2022-04-29 16:26:10 -04:00
parent 5e47e4767e
commit fe28d1554b
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 24 additions and 7 deletions

View file

@ -678,6 +678,8 @@ fn solve(
pools.get_mut(next_rank).extend(pool_variables);
debug_assert_eq!(
// Check that no variable ended up in a higher rank than the next rank.. that
// would mean we generalized one level more than we need to!
{
let offenders = pools
.get(next_rank)
@ -704,7 +706,7 @@ fn solve(
pools.get_mut(next_rank).clear();
// check that things went well
debug_assert!({
if cfg!(debug_assertions) && std::env::var("ROC_VERIFY_RIGID_RANKS").is_ok() {
let rigid_vars = &constraints.variables[let_con.rigid_vars.indices()];
// NOTE the `subs.redundant` check does not come from elm.
@ -720,13 +722,9 @@ fn solve(
let failing: Vec<_> = it.collect();
println!("Rigids {:?}", &rigid_vars);
println!("Failing {:?}", failing);
// nicer error message
failing.is_empty()
} else {
true
assert!(false)
}
});
}
let mut new_env = env.clone();
for (symbol, loc_var) in local_def_vars.iter() {