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
Assignees
Milestone

Comments

@dvyukov
Copy link
Member

@dvyukov 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 dvyukov commented Jul 4, 2015

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

Loading

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 4, 2015

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

Loading

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

@griesemer griesemer commented Jul 10, 2015

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).

Loading

@griesemer griesemer added this to the Go1.5Maybe milestone Jul 10, 2015
@griesemer griesemer removed this from the Go1.6 milestone Jul 10, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 10, 2015

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

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 10, 2015

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

Loading

@ianlancetaylor ianlancetaylor changed the title x/tools/go/types: can shift complex numbers go/types: can shift complex numbers Jul 11, 2015
@griesemer griesemer closed this in e7a10a9 Jul 15, 2015
@mikioh mikioh added this to the Go1.5 milestone Jul 16, 2015
@mikioh mikioh removed this from the Go1.5Maybe milestone 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants