mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
only introduce rigid once!
This commit is contained in:
parent
1fba3702a8
commit
23e8f6c687
2 changed files with 84 additions and 3 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue