only introduce rigid once!

This commit is contained in:
Folkert 2021-09-24 21:53:41 +02:00
parent 1fba3702a8
commit 23e8f6c687
2 changed files with 84 additions and 3 deletions

View file

@ -2906,3 +2906,77 @@ fn do_pass_bool_byte_closure_layout() {
RocStr
);
}
#[test]
fn nested_rigid_list() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [ main ] to "./platform"
foo : List a -> List a
foo = \list ->
p2 : List a
p2 = list
p2
main =
when foo [] is
_ -> "hello world"
"#
),
RocStr::from_slice(b"hello world"),
RocStr
);
}
#[test]
fn nested_rigid_alias() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [ main ] to "./platform"
Identity a : [ @Identity a ]
foo : Identity a -> Identity a
foo = \list ->
p2 : Identity a
p2 = list
p2
main =
when foo (@Identity "foo") is
_ -> "hello world"
"#
),
RocStr::from_slice(b"hello world"),
RocStr
);
}
#[test]
fn nested_rigid_tag_union() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [ main ] to "./platform"
foo : [ @Identity a ] -> [ @Identity a ]
foo = \list ->
p2 : [ @Identity a ]
p2 = list
p2
main =
when foo (@Identity "foo") is
_ -> "hello world"
"#
),
RocStr::from_slice(b"hello world"),
RocStr
);
}