Add a couple tests

This commit is contained in:
Ayaz Hafiz 2022-05-05 09:27:47 -04:00
parent bf91e151e8
commit 143b0f61a8
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -3397,3 +3397,42 @@ fn issue_2894() {
u32
)
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn polymorphic_def_used_in_closure() {
assert_evals_to!(
indoc!(
r#"
a : I64 -> _
a = \g ->
f = { r: g, h: 32 }
h1 : U64
h1 = (\{} -> f.h) {}
h1
a 1
"#
),
32,
u64
)
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[ignore = "This still doesn't work... yet"]
fn polymorphic_lambda_set_usage() {
assert_evals_to!(
indoc!(
r#"
id1 = \x -> x
id2 = \y -> y
id = if True then id1 else id2
id 9u8
"#
),
9,
u8
)
}