Correctly compile unified recursive tag unions

This commit is contained in:
Ayaz Hafiz 2022-07-08 17:31:41 -04:00
parent 8c5f798f4e
commit 808d19b01b
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
7 changed files with 84 additions and 14 deletions

View file

@ -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}
"#
)
}