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

cmd/compile: Incorrect converstion to string #13792

Closed
momchil-velikov opened this issue Dec 31, 2015 · 0 comments
Closed

cmd/compile: Incorrect converstion to string #13792

momchil-velikov opened this issue Dec 31, 2015 · 0 comments

Comments

@momchil-velikov
Copy link
Contributor

In the following program:

package main

import "fmt"

func main() {
    const A = 0xfffffffffffffffff // error
    // const A = 0x8000000000000000 // error
    // const A = 0x7fffffffffffffff // ok
    a := string(A)
    for i, r := range a {
        fmt.Printf("%d: %x\n", i, r)
    }
}

The compiler issues error message overflow in int -> string.

@golang golang locked and limited conversation to collaborators Jan 4, 2017
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

2 participants