Remove var storage TODO

This commit is contained in:
Ayaz Hafiz 2022-11-07 16:57:41 -06:00
parent 4f40d83b80
commit c76a928ed4
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -440,15 +440,10 @@ pub fn constrain_expr(
}
Var(symbol, variable) => {
// Save the expectation in the variable, then lookup the symbol's type in the environment
// TODO don't rewrap expectation
let expected = constraints.expectations[expected.index()].clone();
let expected_type = *expected.get_type_ref();
let expected_type = *constraints.expectations[expected.index()].get_type_ref();
let store_expected = constraints.store(expected_type, *variable, file!(), line!());
let stored_index = constraints.push_type(Variable(*variable));
let stored_type = constraints.push_expected_type(expected.replace(stored_index));
let lookup_constr = constraints.lookup(*symbol, stored_type, region);
let lookup_constr = constraints.lookup(*symbol, expected, region);
constraints.and_constraint([store_expected, lookup_constr])
}