mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Add a couple tests
This commit is contained in:
parent
bf91e151e8
commit
143b0f61a8
1 changed files with 39 additions and 0 deletions
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue