diff --git a/crates/compiler/test_gen/src/gen_primitives.rs b/crates/compiler/test_gen/src/gen_primitives.rs index 6759455af4..b4a450856c 100644 --- a/crates/compiler/test_gen/src/gen_primitives.rs +++ b/crates/compiler/test_gen/src/gen_primitives.rs @@ -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"))]