]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: use "undefined type" rather than "<T>" in have/want error messages
authorRobert Griesemer <gri@golang.org>
Fri, 3 Mar 2023 18:43:02 +0000 (10:43 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 6 Mar 2023 18:21:51 +0000 (18:21 +0000)
commitdbdb3359b5b7cf948d74ba0f95e992ee98933bc5
treeedcf95c24c6084fc66d88da5353096de3b99cedd
parent142d30b2cb036289b27726cee726129087728a66
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>
src/cmd/compile/internal/types2/assignments.go
src/go/types/assignments.go
src/internal/types/testdata/fixedbugs/issue58742.go [new file with mode: 0644]