Skip to content

Commit 770a135

Browse files
tklausermdempsky
authored andcommitted
cmd/compile: use yyerrorl in some typechecking functions
Replace usage of yyerror with yyerrorl in checkdefergo and copytype in typecheck.go. All covered error messages already appear in the tests and the yyerror replacement did not lead to any tests failing. Passes toolstash-check Updates #19683 Change-Id: I735e83bcda7ddc6a14afb22e50200bcbb9192fc4 Reviewed-on: https://go-review.googlesource.com/c/go/+/69910 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent b2f4001 commit 770a135

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cmd/compile/internal/gc/typecheck.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ func checkdefergo(n *Node) {
22042204
if n.Left.Orig != nil && n.Left.Orig.Op == OCONV {
22052205
break
22062206
}
2207-
yyerror("%s discards result of %v", what, n.Left)
2207+
yyerrorl(n.Pos, "%s discards result of %v", what, n.Left)
22082208
return
22092209
}
22102210

@@ -2218,7 +2218,7 @@ func checkdefergo(n *Node) {
22182218
// The syntax made sure it was a call, so this must be
22192219
// a conversion.
22202220
n.SetDiag(true)
2221-
yyerror("%s requires function call, not conversion", what)
2221+
yyerrorl(n.Pos, "%s requires function call, not conversion", what)
22222222
}
22232223
}
22242224

0 commit comments

Comments
 (0)