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/parser: valid conversion using a map type literal is rejected #10211

Closed
cznic opened this issue Mar 21, 2015 · 1 comment
Closed

go/parser: valid conversion using a map type literal is rejected #10211

cznic opened this issue Mar 21, 2015 · 1 comment

Comments

@cznic
Copy link
Contributor

cznic commented Mar 21, 2015

This code (playgound)

package main

type t map[int]int

func main() {
    t := map[int]int{}
    map[int]int(t)[1] = 2
    println("ok")
}

compiles and runs ok, but clicking Format fails because go/parser reports

7:2: expected statement, found 'map' (and 1 more errors).

@griesemer griesemer self-assigned this Mar 21, 2015
@cznic cznic changed the title go/parser: valid conversion using a map type literal type is rejected go/parser: valid conversion using a map type literal is rejected Mar 21, 2015
@minux
Copy link
Member

minux commented Mar 21, 2015

Already fixed on tip.

@minux minux closed this as completed Mar 21, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 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

4 participants