Merge branch 'trunk' into nested-rigid-introduced-twice

This commit is contained in:
Folkert de Vries 2021-10-03 23:55:23 +02:00 committed by GitHub
commit 3d82369bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
119 changed files with 11699 additions and 4281 deletions

View file

@ -2980,3 +2980,30 @@ fn nested_rigid_tag_union() {
RocStr
);
}
#[test]
fn call_that_needs_closure_parameter() {
// here both p2 is lifted to the top-level, which means that `list` must be
// passed to it from `manyAux`.
assert_evals_to!(
indoc!(
r#"
Step state a : [ Loop state, Done a ]
manyAux : List a -> [ Pair (Step (List a) (List a))]
manyAux = \list ->
p2 = \_ -> Pair (Done list)
p2 "foo"
manyAuxTest = (manyAux [ ]) == Pair (Loop [97])
runTest = \t -> if t then "PASS" else "FAIL"
runTest manyAuxTest
"#
),
RocStr::from_slice(b"FAIL"),
RocStr
);
}