Merge pull request #4556 from roc-lang/fix-fixpoint-fixing

Correct when fixpoint-fixed type variables can be reunified
This commit is contained in:
Ayaz 2022-11-21 17:44:06 -06:00 committed by GitHub
commit ef5d83a42d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 2 deletions

View file

@ -2047,3 +2047,39 @@ fn issue_4077_fixed_fixpoint() {
RocStr
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn unify_types_with_fixed_fixpoints_outside_fixing_region() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
Input := [
FromJob Job (List Str),
]
Job := [
Job (List Input)
]
job : List Input -> Job
job = \inputs ->
@Job (Job inputs)
helloWorld : Job
helloWorld =
@Job ( Job [ @Input (FromJob greeting []) ] )
greeting : Job
greeting =
job []
main = (\_ -> "OKAY") helloWorld
"#
),
RocStr::from("OKAY"),
RocStr
);
}