Permit binding variables multiple itmes in when branches

This commit is contained in:
Ayaz Hafiz 2022-07-21 11:06:40 -04:00
parent c48c4f3183
commit bf8fc0d0de
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
6 changed files with 78 additions and 31 deletions

View file

@ -7357,4 +7357,18 @@ mod solve_expr {
"List (A U8)",
);
}
#[test]
fn shared_pattern_variable_in_when_branches() {
infer_eq_without_problem(
indoc!(
r#"
when A "" is
A x | B x -> x
C y | D y -> y
"#
),
"",
);
}
}