mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-23 12:02:28 +00:00
Remove var storage TODO
This commit is contained in:
parent
4f40d83b80
commit
c76a928ed4
1 changed files with 2 additions and 7 deletions
|
@ -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])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue