mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-25 05:33:14 +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
|
|
@ -7360,15 +7360,21 @@ mod solve_expr {
|
|||
|
||||
#[test]
|
||||
fn shared_pattern_variable_in_when_branches() {
|
||||
infer_eq_without_problem(
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
when A "" is
|
||||
# ^^^^
|
||||
A x | B x -> x
|
||||
C y | D y -> y
|
||||
# ^ ^ ^
|
||||
"#
|
||||
),
|
||||
"",
|
||||
@r###"
|
||||
A "" : [A Str, B Str]
|
||||
x : Str
|
||||
x : Str
|
||||
x : Str
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue