mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
Add a couple tests
This commit is contained in:
parent
bf91e151e8
commit
143b0f61a8
@ -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…
Reference in New Issue
Block a user