mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Merge branch 'top-level-thunks' into sized-functions-inference
This commit is contained in:
commit
de8ad07f2e
84 changed files with 5060 additions and 2287 deletions
|
@ -67,6 +67,7 @@ pub fn constrain_decls(
|
|||
|
||||
// perform usage analysis on the whole file
|
||||
let mut var_usage = VarUsage::default();
|
||||
|
||||
for decl in decls.iter().rev() {
|
||||
// NOTE: rigids are empty because they are not shared between top-level definitions
|
||||
match decl {
|
||||
|
@ -1445,6 +1446,7 @@ pub fn constrain_expr(
|
|||
}
|
||||
|
||||
Accessor {
|
||||
function_var,
|
||||
field,
|
||||
record_var,
|
||||
closure_var,
|
||||
|
@ -1490,6 +1492,7 @@ pub fn constrain_expr(
|
|||
exists(
|
||||
vec![
|
||||
*record_var,
|
||||
*function_var,
|
||||
*closure_var,
|
||||
*field_var,
|
||||
*ext_var,
|
||||
|
@ -1497,7 +1500,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