-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
agen PLUS #1710
Labels
Comments
Ah, ha Here is the smallest possible program that will trigger the error package main func main() { str := "" for _, v := range make([]byte, 100) { str =+ string(v) } _ = str } % 6g 1710.go 1710.go:6: internal compiler error: agen: unknown op PLUS u(100) l(6) x(-1000000000) tc(1) string however, if we gofmt that program, we get this package main func main() { str := "" for _, v := range make([]byte, 100) { str = +string(v) } _ = str } which reveals the that this isn't a compiler error, but a syntax checking error, as the correct syntax for appending to strings is +=, no =+ |
Ah, ha Here is the smallest possible program that will trigger the error package main func main() { str := "" for _, v := range make([]byte, 100) { str =+ string(v) } _ = str } % 6g 1710.go 1710.go:6: internal compiler error: agen: unknown op PLUS u(100) l(6) x(-1000000000) tc(1) string however, if we gofmt that program, we get this package main func main() { str := "" for _, v := range make([]byte, 100) { str = +string(v) } _ = str } which reveals the that this isn't a compiler error, but a syntax checking error, as the correct syntax for appending to strings is +=, not =+. http://golang.org/doc/go_spec.html#Arithmetic_operators |
The fix should be easy: update the appropriate table and add a test case. Owner changed to @rsc. Status changed to HelpWanted. |
This issue was closed by revision ec735c4. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by Confunctionist:
Attachments:
The text was updated successfully, but these errors were encountered: