mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
code gen Accessor
This commit is contained in:
parent
bb6f36ad28
commit
c8e5acf142
6 changed files with 96 additions and 27 deletions
|
@ -1445,6 +1445,7 @@ pub fn constrain_expr(
|
|||
}
|
||||
|
||||
Accessor {
|
||||
function_var,
|
||||
field,
|
||||
record_var,
|
||||
closure_var,
|
||||
|
@ -1490,6 +1491,7 @@ pub fn constrain_expr(
|
|||
exists(
|
||||
vec![
|
||||
*record_var,
|
||||
*function_var,
|
||||
*closure_var,
|
||||
*field_var,
|
||||
*ext_var,
|
||||
|
@ -1497,7 +1499,16 @@ pub fn constrain_expr(
|
|||
field_uniq_var,
|
||||
record_uniq_var,
|
||||
],
|
||||
And(vec![Eq(fn_type, expected, category, region), record_con]),
|
||||
And(vec![
|
||||
Eq(fn_type.clone(), expected, category.clone(), region),
|
||||
Eq(
|
||||
fn_type,
|
||||
Expected::NoExpectation(Variable(*function_var)),
|
||||
category,
|
||||
region,
|
||||
),
|
||||
record_con,
|
||||
]),
|
||||
)
|
||||
}
|
||||
RuntimeError(_) => True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue