]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: report type name in comp. literal error, if possible
authorRobert Griesemer <gri@golang.org>
Tue, 25 Jun 2024 22:31:06 +0000 (15:31 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 26 Jul 2024 20:11:56 +0000 (20:11 +0000)
commit05099368239650c0931d6521eeb0c707296c90bc
tree669bbf29785aa6231651768781f691445653407d
parent77a3c3b984c22186a9f9ec17b13c2d13060bc9c9
go/types, types2: report type name in comp. literal error, if possible

When reporting an error for the element type of a struct literal, use
the element type's type name rather than it's underlying/core type.

Also, combine error reporting for invalid composite literal types in
one place, at the end.

Fixes #68184.

Change-Id: I1f407d5403777948da9a0eca95aacc1389f4bd44
Reviewed-on: https://go-review.googlesource.com/c/go/+/595075
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Tim King <taking@google.com>
src/cmd/compile/internal/types2/expr.go
src/go/types/expr.go
src/internal/types/testdata/fixedbugs/issue68184.go [new file with mode: 0644]