Merge pull request #4525 from roc-lang/fix-fixpoints-2

Implement fixpoint-fixing and unconditionally emplace variables into type indices
This commit is contained in:
Ayaz 2022-11-19 17:47:02 -06:00 committed by GitHub
commit 1a3119e4c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 723 additions and 119 deletions

View file

@ -8198,6 +8198,31 @@ mod solve_expr {
);
}
#[test]
fn inferred_fixed_fixpoints() {
infer_queries!(
indoc!(
r#"
app "test" provides [job] to "./platform"
F : [Bar, FromG G]
G : [G {lst : List F}]
job : { lst : List F } -> G
job = \config -> G config
#^^^{-1}
# ^^^^^^ ^^^^^^^^
"#
),
@r###"
job : { lst : List [Bar, FromG a] } -[[job(0)]]-> [G { lst : List [Bar, FromG a] }] as a
config : { lst : List [Bar, FromG ([G { lst : List [Bar, FromG a] }] as a)] }
G config : [G { lst : List [Bar, FromG a] }] as a
"###
print_only_under_alias: true
);
}
#[test]
fn fix_recursion_under_alias_issue_4368() {
infer_eq_without_problem(
@ -8218,7 +8243,7 @@ mod solve_expr {
"#
),
"{} -> Task",
)
);
}
#[test]