mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
go/types, types2: use "undefined type" rather than "<T>" in have/want error messages
In assignments and return statements, if we have the wrong number of LHS or return values, we report the pattern that we have and the pattern that we want. For untyped constants we use "number" (to be not overly specific). For unknown types (due to earlier errors), now use "unknown type" rather than the (cryptic) "<T>". Fixes #58742. Change-Id: I69c84ee29fb64badb0121e26a96f003b381024aa Reviewed-on: https://go-review.googlesource.com/c/go/+/473255 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
142d30b2cb
commit
dbdb3359b5
3 changed files with 20 additions and 2 deletions
|
|
@ -266,7 +266,7 @@ func (check *Checker) typesSummary(list []Type, variadic bool) string {
|
|||
case t == nil:
|
||||
fallthrough // should not happen but be cautious
|
||||
case t == Typ[Invalid]:
|
||||
s = "<T>"
|
||||
s = "unknown type"
|
||||
case isUntyped(t):
|
||||
if isNumeric(t) {
|
||||
// Do not imply a specific type requirement:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue