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: compiler allows "-ddddp±ddd" notation for integer/float literals #12126

Closed
dsnet opened this issue Aug 13, 2015 · 3 comments
Closed
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented Aug 13, 2015

Using go1.5rc1.

The following code compiles and runs:

import "fmt"

const foo = 1p10

func main() {
    fmt.Println(foo)
}

But if you try to run gofmt, it fails:

5:14: expected ';', found 'IDENT' p10

At first, I thought it was a gofmt bug, but it turns out that the "-ddddp±ddd" notation is not part of the language specification. I expect the compiler to reject this if it is not part of the spec.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Aug 13, 2015
@dr2chase
Copy link
Contributor

I thought I fixed this. See #9036 .

@dsnet
Copy link
Member Author

dsnet commented Aug 13, 2015

Ah, this is my fault. The computer I'm on at the moment has go1.4.2. The computer I usually use is running go1.5rc1.

Please close.

@dr2chase
Copy link
Contributor

Always happy to fix bugs without touching code.

@mikioh mikioh modified the milestones: Go1.5, Unplanned Aug 13, 2015
@golang golang locked and limited conversation to collaborators Aug 22, 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