mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-19 10:09:47 +00:00
Correctly compile unified recursive tag unions
This commit is contained in:
parent
8c5f798f4e
commit
808d19b01b
7 changed files with 84 additions and 14 deletions
|
@ -1718,3 +1718,66 @@ fn call_function_in_empty_list_unbound() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
#[ignore = "TODO"]
|
||||
fn instantiate_annotated_as_recursive_alias_toplevel() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [it] to "./platform"
|
||||
|
||||
Value : [Nil, Array (List Value)]
|
||||
|
||||
foo : [Nil]*
|
||||
foo = Nil
|
||||
|
||||
it : Value
|
||||
it = foo
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn instantiate_annotated_as_recursive_alias_polymorphic_expr() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
Value : [Nil, Array (List Value)]
|
||||
|
||||
foo : [Nil]*
|
||||
foo = Nil
|
||||
|
||||
it : Value
|
||||
it = foo
|
||||
|
||||
it
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn instantiate_annotated_as_recursive_alias_multiple_polymorphic_expr() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
Value : [Nil, Array (List Value)]
|
||||
|
||||
foo : [Nil]*
|
||||
foo = Nil
|
||||
|
||||
v1 : Value
|
||||
v1 = foo
|
||||
|
||||
Value2 : [Nil, B U16, Array (List Value)]
|
||||
|
||||
v2 : Value2
|
||||
v2 = foo
|
||||
|
||||
{v1, v2}
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue