Skip to content

Bug: Shifting an integer with a uint64 variable #418

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

Closed
hajimehoshi opened this issue Mar 7, 2016 · 3 comments
Closed

Bug: Shifting an integer with a uint64 variable #418

hajimehoshi opened this issue Mar 7, 2016 · 3 comments
Labels

Comments

@hajimehoshi
Copy link
Member

package main

import (
    "fmt"
)

func main() {
    x := uint64(0)
    fmt.Println(1<<x) // 0
    fmt.Println(1<<0) // 1 as expected
}

The former should print 1 but 0 in GopherJS.

@hajimehoshi
Copy link
Member Author

http://www.gopherjs.org/play/#/vK0DYwzcy6 Here is the runnable snippet

@dmitshur dmitshur added the bug label Mar 7, 2016
@dmitshur
Copy link
Member

dmitshur commented Mar 7, 2016

Thanks for reporting @hajimehoshi.

@neelance
Copy link
Member

neelance commented Mar 7, 2016

@hajimehoshi Thx!

dmitshur added a commit to gopherjs/gopherjs.github.io that referenced this issue Mar 8, 2016
go generate github.com/gopherjs/gopherjs.github.io/...

Includes fix for gopherjs/gopherjs#418.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants