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: missing error for invalid map literal key #44432

Closed
cuonglm opened this issue Feb 19, 2021 · 2 comments
Closed

cmd/compile: missing error for invalid map literal key #44432

cuonglm opened this issue Feb 19, 2021 · 2 comments
Milestone

Comments

@cuonglm
Copy link
Contributor

@cuonglm cuonglm commented Feb 19, 2021

What version of Go are you using (go version)?

tip

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

package p

var m = map[string]int{
	"a": 1,
	1:   1,
	2:   2,
}

What did you expect to see?

p.go:5:2: cannot use 1 (type untyped int) as type string in map key
p.go:6:2: cannot use 2 (type untyped int) as type string in map key

What did you see instead?

p.go:5:2: cannot use 1 (type untyped int) as type string in map key
@gopherbot
Copy link

@gopherbot gopherbot commented Feb 19, 2021

Change https://golang.org/cl/294034 mentions this issue: cmd/compile: pass a value to constSet.add

@cagedmantis cagedmantis added this to the Go1.17 milestone Feb 22, 2021
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Feb 22, 2021

@gopherbot gopherbot closed this in 1d0256a Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants