From a485406e3ddc8bd0c79ea39f2bc99206152fb7fb Mon Sep 17 00:00:00 2001 From: rvcas Date: Tue, 24 Jan 2023 10:26:08 -0500 Subject: [PATCH] fix: use the location of the pattern not the entire clause --- crates/aiken-lang/src/tipo/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/aiken-lang/src/tipo/expr.rs b/crates/aiken-lang/src/tipo/expr.rs index cf9775ab..caf237a0 100644 --- a/crates/aiken-lang/src/tipo/expr.rs +++ b/crates/aiken-lang/src/tipo/expr.rs @@ -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()),