fix: use the location of the pattern not the entire clause

This commit is contained in:
rvcas 2023-01-24 10:26:08 -05:00 committed by Lucas
parent 7206360baa
commit a485406e3d
1 changed files with 1 additions and 1 deletions

View File

@ -1934,7 +1934,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
// that suggests that a `let` binding should be used instead.
if clauses.len() == 1 {
self.environment.warnings.push(Warning::SingleWhenClause {
location: clauses[0].location,
location: clauses[0].pattern[0].location(),
sample: UntypedExpr::Assignment {
location: Span::empty(),
value: Box::new(subjects[0].clone()),