-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: unexpected error referring to blank field in struct composite literal #18089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Bisecting identifies c39918a as the source of regression. (cc @aclements @randall77 for FYI, since this seems like a somewhat surprising/unintended consequence of that CL) It's worth noting that
used to fail too, as did:
So while failing to compile Also, for #17728, I'm interested in moving the logic for decomposing composite-literal assignments into SSA, which I expect will address these issues. |
@griesemer and @mdempsky, this issue seems fixed on tip by commit 3e11940 and CL https://go-review.googlesource.com/c/34988/ $ go version
go version devel +11eaf42 Sat Apr 29 04:15:49 2017 +0000 darwin/amd64
$ cat main.go
package main
type T struct {
x int
_ int
}
func main() {
_ = T{0, 0}
}
$ go run main.go |
PS: It works alright on the playground and was fixed already for Go1.8; that CL got in on January 9th 2017. |
I'm puzzled both by how the first commit could have broke this and how the second commit could have fixed it. CL 38006, for example, seems more relevant. In any case, @odeke-em, want to send a CL adding this code as a test case and mark it as fixing this issue? |
My thoughts exactly @josharian: I started by examining before and after Sounds like a plan, let me mail the test case. |
CL https://golang.org/cl/42173 mentions this issue. |
Updates #18089. Test for that issue; it was inadvertently fixed by CL 34988. Ensure that we don't regress on the fix. Change-Id: Icb85fc20dbb0a47f028f088281319b552b16759d Reviewed-on: https://go-review.googlesource.com/42173 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
https://play.golang.org/p/mJtCue1M24 is a valid program that compiles and runs in the playground.
However, it fails at tip (go version devel +8a2c34e Tue Nov 29 00:24:22 2016 +0000 darwin/amd64):
This is a regression from 1.7 and needs to be fixed for 1.8.
The text was updated successfully, but these errors were encountered: