mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Add multi-branch bound pattern solve test
This commit is contained in:
parent
92e363f4ef
commit
7fbdbca4c6
1 changed files with 26 additions and 1 deletions
|
@ -7359,7 +7359,7 @@ mod solve_expr {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn shared_pattern_variable_in_when_branches() {
|
||||
fn shared_pattern_variable_in_when_patterns() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
|
@ -7377,4 +7377,29 @@ mod solve_expr {
|
|||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shared_pattern_variable_in_multiple_branch_when_patterns() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
when A "" is
|
||||
# ^^^^
|
||||
A x | B x -> x
|
||||
# ^ ^ ^
|
||||
C x | D x -> x
|
||||
# ^ ^ ^
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
A "" : [A Str, B Str, C Str, D Str]
|
||||
x : Str
|
||||
x : Str
|
||||
x : Str
|
||||
x : Str
|
||||
x : Str
|
||||
x : Str
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue