mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Add test when bound symbols differ in branch patterns, but no bound symbol is used
This commit is contained in:
parent
ee516eaa2f
commit
ed6ee71225
1 changed files with 19 additions and 0 deletions
|
@ -3660,6 +3660,25 @@ fn shared_pattern_variable_in_when_branches() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn symbol_not_bound_in_all_patterns_runs_when_no_bound_symbol_used() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
f = \t -> when t is
|
||||
A x | B y -> 31u8
|
||||
|
||||
{a: f (A 15u8), b: f (B 15u8)}
|
||||
"#
|
||||
),
|
||||
31u8,
|
||||
u8,
|
||||
|x| x,
|
||||
true // allow errors
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "TODO currently fails in alias analysis because `B y` does not introduce `x`"]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue