diff --git a/crates/compiler/constrain/src/pattern.rs b/crates/compiler/constrain/src/pattern.rs index b23240e76c..3b3ce10a3d 100644 --- a/crates/compiler/constrain/src/pattern.rs +++ b/crates/compiler/constrain/src/pattern.rs @@ -512,13 +512,13 @@ pub fn constrain_pattern( let expected = constraints.push_pat_expected_type(PExpected::NoExpectation(pat_type_index)); - let (guard_var, loc_guard) = typ; + let (guard_var, loc_pattern) = typ; let elem_type = { let guard_type = constraints.push_variable(*guard_var); let expected_pat = constraints.push_pat_expected_type(PExpected::ForReason( PReason::PatternGuard, pat_type_index, - loc_guard.region, + loc_pattern.region, )); state.constraints.push(constraints.pattern_presence( @@ -533,8 +533,8 @@ pub fn constrain_pattern( types, constraints, env, - &loc_guard.value, - loc_guard.region, + &loc_pattern.value, + loc_pattern.region, expected, state, );