You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Go spec says "The LiteralType's underlying type must be a struct, array, slice, or map type (the grammar enforces this constraint except when the type is given as a TypeName)."
cmd/compile and go/types report "invalid composite literal type" for all four pointer-typed composite literals, but gccgo 10.2.1 accepts them:
package main
type S struct{}
type A *S
type B = *S
type C *struct{}
type D = *struct{}
var (
_ = A{}
_ = B{}
_ = C{}
_ = D{}
)
Many compiler tests fail with -G=3 due to changes in error message format.
This commit fixes two of these tests, to ensure I am on the right track in review.
Updates #46447
Change-Id: I138956d536a1d48ca9198e6ddbfde13865bb5dd5
GitHub-Last-Rev: 0ed904b
GitHub-Pull-Request: #46445
Reviewed-on: https://go-review.googlesource.com/c/go/+/323314
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
The Go spec says "The LiteralType's underlying type must be a struct, array, slice, or map type (the grammar enforces this constraint except when the type is given as a TypeName)."
cmd/compile and go/types report "invalid composite literal type" for all four pointer-typed composite literals, but gccgo 10.2.1 accepts them:
/cc @ianlancetaylor
The text was updated successfully, but these errors were encountered: