mirror of
https://github.com/golang/go.git
synced 2026-06-28 03:40:37 +00:00
cmd/compile: fixed error message about println says print
When one of the arguments to println has an invalid type, the error message incorrectly mentions print instead of println. This CL fixes the error message. Fixed #79258 Change-Id: I9f3c1b08263a834a2068b96b57a4fd7a92af9ffe Reviewed-on: https://go-review.googlesource.com/c/go/+/775800 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
parent
5b106947d1
commit
f552547748
2 changed files with 12 additions and 1 deletions
|
|
@ -744,7 +744,7 @@ func walkPrint(nn *ir.CallExpr, init *ir.Nodes) ir.Node {
|
|||
}
|
||||
}
|
||||
default:
|
||||
badtype(ir.OPRINT, n.Type(), nil)
|
||||
badtype(nn.Op(), n.Type(), nil)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
11
test/fixedbugs/issue79258.go
Normal file
11
test/fixedbugs/issue79258.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// errorcheck -std
|
||||
|
||||
// Copyright 2026 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
println([1]byte{}) // ERROR "illegal types for operand: println"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue