-
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
go/types: string(1 << s) should be an error #26096
Comments
In this case ( |
Indeed. Thanks!
- gri
… —
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#26096 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIIkTz1DNDGIP360-WywgYHcVHHXxWrjks5uBBMzgaJpZM4U6bt6>
.
|
Also related: #21982 |
On (go/types) conversions.go:61 we select Unfortunately, doing nothing there causes regular conversions (such as Fixing this requires a bit more subtle changes. Postponing for now since this is a) unlikely to occur in real programs, b) there are easy work-arounds, and c) this doesn't prevent go/types from accepting legal programs. The issue may also become moot if we remove string(int/rune) conversions (#3939). |
(https://play.golang.org/p/owHsmdZd32v) is an error: The
1
in1 << s
assumes the type it would have without the shift, which isstring
. Both cm/compile and gccgo correct report an error.go/types appears to accept it.
The text was updated successfully, but these errors were encountered: