mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
use equal_types_with_storage in record constraining
This commit is contained in:
parent
6baae55980
commit
f23945ad94
1 changed files with 3 additions and 11 deletions
|
@ -126,25 +126,17 @@ pub fn constrain_expr(
|
|||
// lifetime parameter on `Type`
|
||||
Box::new(Type::EmptyRec),
|
||||
);
|
||||
let record_con = constraints.equal_types(
|
||||
|
||||
let record_con = constraints.equal_types_with_storage(
|
||||
record_type,
|
||||
expected.clone(),
|
||||
Category::Record,
|
||||
region,
|
||||
*record_var,
|
||||
);
|
||||
|
||||
rec_constraints.push(record_con);
|
||||
|
||||
// variable to store in the AST
|
||||
let stored_con = constraints.equal_types_var(
|
||||
*record_var,
|
||||
expected,
|
||||
Category::Storage(std::file!(), std::line!()),
|
||||
region,
|
||||
);
|
||||
|
||||
field_vars.push(*record_var);
|
||||
rec_constraints.push(stored_con);
|
||||
|
||||
let and_constraint = constraints.and_constraint(rec_constraints);
|
||||
constraints.exists(field_vars, and_constraint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue