]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use yyerrorl in some typechecking functions
authorTobias Klauser <tklauser@distanz.ch>
Wed, 11 Oct 2017 12:49:39 +0000 (14:49 +0200)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 26 Sep 2019 06:48:55 +0000 (06:48 +0000)
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>

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

index 580e9154e1d93c18f7979eebbf2dcc952998ef2d..7d0d5f35be9b79fd67efb32db06033c72a6ab24b 100644 (file)
@@ -2204,7 +2204,7 @@ func checkdefergo(n *Node) {
                if n.Left.Orig != nil && n.Left.Orig.Op == OCONV {
                        break
                }
-               yyerror("%s discards result of %v", what, n.Left)
+               yyerrorl(n.Pos, "%s discards result of %v", what, n.Left)
                return
        }
 
@@ -2218,7 +2218,7 @@ func checkdefergo(n *Node) {
                // The syntax made sure it was a call, so this must be
                // a conversion.
                n.SetDiag(true)
-               yyerror("%s requires function call, not conversion", what)
+               yyerrorl(n.Pos, "%s requires function call, not conversion", what)
        }
 }