mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
make record variable names clearer
This commit is contained in:
parent
1a8f380033
commit
e62ddc9ef5
5 changed files with 29 additions and 17 deletions
|
@ -457,12 +457,12 @@ pub fn constrain_expr(
|
|||
),
|
||||
)
|
||||
}
|
||||
Record(variable, fields) => {
|
||||
Record { record_var, fields } => {
|
||||
// NOTE: canonicalization guarantees at least one field
|
||||
// zero fields generates an EmptyRecord
|
||||
let mut field_types = SendMap::default();
|
||||
let mut field_vars = Vec::with_capacity(fields.len());
|
||||
field_vars.push(*variable);
|
||||
field_vars.push(*record_var);
|
||||
|
||||
// Constraints need capacity for each field + 1 for the record itself + 1 for ext
|
||||
let mut constraints = Vec::with_capacity(2 + fields.len());
|
||||
|
@ -501,7 +501,7 @@ pub fn constrain_expr(
|
|||
),
|
||||
);
|
||||
let record_con = Eq(record_type, expected.clone(), region);
|
||||
let ext_con = Eq(Type::Variable(*variable), expected, region);
|
||||
let ext_con = Eq(Type::Variable(*record_var), expected, region);
|
||||
|
||||
constraints.push(record_con);
|
||||
constraints.push(ext_con);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue