mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Support bound variables in multiple patterns
This commit is contained in:
parent
bf8fc0d0de
commit
ce8b50caea
3 changed files with 59 additions and 4 deletions
|
@ -3641,3 +3641,21 @@ fn recursive_call_capturing_function() {
|
|||
i64
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn shared_pattern_variable_in_when_branches() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
f = \t ->
|
||||
when t is
|
||||
A x | B x -> x
|
||||
|
||||
{a: f (A 15u8), b: (B 31u8)}
|
||||
"#
|
||||
),
|
||||
(15u8, 31u8),
|
||||
(u8, u8)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue