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: duplicate index error should distinguish arrays and slices #35291

Closed
josharian opened this issue Oct 31, 2019 · 1 comment
Closed
Labels
FrozenDueToAge help wanted Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@josharian
Copy link
Contributor

package main

var s = []string{
	1: "dup",
	1: "dup",
}

https://play.golang.org/p/cncTK4uwake

Compile. Result:

./prog.go:5:2: duplicate index in array literal: 1

But the duplicate index is in a slice literal, not an array literal.

Probably an artifact of how cmd/compile used to use TARRAY to represent both arrays and slices.

Low priority, but probably also an easy fix. Might be a good first issue for someone interested in the compilerr.

@josharian josharian added Suggested Issues that may be good for new contributors looking for work to do. help wanted labels Oct 31, 2019
@josharian josharian added this to the Unplanned milestone Oct 31, 2019
@gopherbot
Copy link

Change https://golang.org/cl/204617 mentions this issue: cmd/compile: make duplicate index error distinguish arrays and slices

@golang golang locked and limited conversation to collaborators Oct 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

2 participants