-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/compile: crash on package name used as value in constant declaration #15265
Comments
Message is:
|
@bradfitz Ah yes I should've added that to my original comment. |
Ok, thus is something we should fix. This isn't a syntax error, that code On Wed, 13 Apr 2016, 08:52 Eric Lagergren, notifications@github.com wrote:
|
Additionally, it crashes with integer literals: https://play.golang.org/p/mztla8DYUz And afaik anything else that is considered a constant expression. @bradfitz Should the title be changed to reflect this affects both integer and string literals? |
@ericlagergren Thanks for the report. Minimal repro:
I think the fix is as simple as adding |
Dup of #11361 |
Closing as dup. |
This is seemingly low-priority. I only ran into this because of a typo but it threw me off for a second.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.6
What operating system and processor architecture are you using (
go env
)?GOOS=linux
GOARCH=amd64
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/M93SytJouJ
What did you expect to see?
An error message telling me that what I did was stupid.
E.g.: "Cannot concatenate identifier 'fmt'"
What did you see instead?
A cryptic message
The text was updated successfully, but these errors were encountered: