mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Add test gen for multimorphic capture
This commit is contained in:
parent
8be230695b
commit
ada4b0ea43
3 changed files with 49 additions and 1 deletions
|
@ -3498,3 +3498,30 @@ fn polymorphic_lambda_captures_polymorphic_value() {
|
|||
u64
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn multimorphic_lambda_set_u64_vs_u8_capture() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
capture : _ -> ({} -> Str)
|
||||
capture = \val ->
|
||||
\{} ->
|
||||
Num.toStr val
|
||||
|
||||
x : [True, False]
|
||||
x = True
|
||||
|
||||
fun =
|
||||
when x is
|
||||
True -> capture 123u64
|
||||
False -> capture 18u8
|
||||
|
||||
fun {}
|
||||
"#
|
||||
),
|
||||
RocStr::from("123"),
|
||||
RocStr
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue