diff --git a/compiler/mono/src/exhaustive.rs b/compiler/mono/src/exhaustive.rs index 4170015a7b..e9804e2c27 100644 --- a/compiler/mono/src/exhaustive.rs +++ b/compiler/mono/src/exhaustive.rs @@ -353,7 +353,7 @@ fn to_nonredundant_rows( vec![simplify(&loc_pat.value)] }; - if is_useful(checked_rows.clone(), next_row.clone()) { + if any_has_guard || is_useful(checked_rows.clone(), next_row.clone()) { checked_rows.push(next_row); } else { return Err(Error::Redundant { diff --git a/compiler/test_gen/src/gen_tags.rs b/compiler/test_gen/src/gen_tags.rs index 40e5403914..74b8da70ec 100644 --- a/compiler/test_gen/src/gen_tags.rs +++ b/compiler/test_gen/src/gen_tags.rs @@ -502,7 +502,6 @@ fn when_on_single_value_tag() { } #[test] -#[ignore] fn if_guard_multiple() { assert_evals_to!( indoc!(