Skip to content
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: can shift complex numbers #11594

Closed
dvyukov opened this issue Jul 4, 2015 · 5 comments
Closed

go/types: can shift complex numbers #11594

dvyukov opened this issue Jul 4, 2015 · 5 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 4, 2015

gotype successfully compiles the following program:

package a
var a = complex64(1) << 2

gccgo also compiles it. gc rejects it saying:

invalid operation: complex64(1) << 2 (shift of type complex64)

Spec says that lhs of shift must be an integer.

@dvyukov
Copy link
Member Author

dvyukov commented Jul 4, 2015

@griesemer if my reading of the spec is correct, then we also need to file a bug on gccgo.

@griesemer
Copy link
Contributor

This is clearly a go/types bug. Should be trivial to fix and probably should be fixed for 1.5.

@griesemer griesemer added this to the Go1.5Maybe milestone Jul 4, 2015
@ianlancetaylor ianlancetaylor modified the milestones: Go1.6, Go1.5Maybe Jul 10, 2015
@griesemer
Copy link
Contributor

The fix is trivial (one missing predicate check). Can safely go in for 1.5 as far as I am concerned.

https://go-review.googlesource.com/#/c/12045/

(includes tests).

@griesemer griesemer modified the milestones: Go1.5Maybe, Go1.6 Jul 10, 2015
@gopherbot
Copy link

CL https://golang.org/cl/12045 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/12046 mentions this issue.

@ianlancetaylor ianlancetaylor changed the title x/tools/go/types: can shift complex numbers go/types: can shift complex numbers Jul 11, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 16, 2015
griesemer added a commit to golang/tools that referenced this issue Jul 21, 2015
Backport of https://go-review.googlesource.com/#/c/12045/

Fixes golang/go#11594.

Change-Id: I3c81e2b1bbdc084d4a323fd963c1c780054ce223
Reviewed-on: https://go-review.googlesource.com/12046
Reviewed-by: Alan Donovan <adonovan@google.com>
@golang golang locked and limited conversation to collaborators Jul 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants