]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: report error for incomplete struct composite literal...
authorRobert Griesemer <gri@golang.org>
Fri, 5 Nov 2021 04:31:08 +0000 (21:31 -0700)
committerRobert Griesemer <gri@golang.org>
Sat, 6 Nov 2021 19:41:15 +0000 (19:41 +0000)
commit61d789db3a52e4570596f1fd15122358deb73b77
treefac1793a8c220f70e8a56b3fc1a966c962375965
parentcfb3dc7710ba35d9932ba9f5242730a97f9ae603
cmd/compile/internal/types2: report error for incomplete struct composite literal type

Mark a struct as "complete" with a non-nil (but possibly zero length)
fields list. Add a test when type-checking struct composite literals,
the same way we do for other composite literal types.

Fixes #49276.

Change-Id: If44a3d790bf7032ddcd155af49bdc47b1cdff4fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/361412
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/struct.go
src/cmd/compile/internal/types2/subst.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue49276.go [new file with mode: 0644]