-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: crash when compiling function named "_" #29870
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
Change https://golang.org/cl/158845 mentions this issue: |
This was introduced as part of adding stack objects. Fix out for review. Do we care about functions named "_"? Is there any legitimate use for them? If so, we should fix this in 1.12. If not, we can leave for 1.13. |
I could imagine someone using them to contain static assertions: that is, a function named I don't know whether anyone does that in practice. |
Exactly. They must be type-checked, but there's no need to generate code for them. |
Change https://golang.org/cl/158820 mentions this issue: |
The latter CL is for 1.12. The former CL has more clean up in it and will go in for 1.13. |
They can't be used, so we don't need code generated for them. We just need to report errors in their bodies. This is the minimal CL for 1.12. For 1.13, CL 158845 will remove a bunch of special cases sprinkled about the compiler to handle "_" functions, which should (after this CL) be unnecessary. Update #29870 Change-Id: Iaa1c194bd0017dffdce86589fe2d36726ee83c13 Reviewed-on: https://go-review.googlesource.com/c/158820 Run-TryBot: Keith Randall <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The text was updated successfully, but these errors were encountered: