Skip to content

cmd/compile: duplicate index error should distinguish arrays and slices #35291

Closed

Description

@josharian
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.

Activity

  1. added
    SuggestedIssues that may be good for new contributors looking for work to do.
    on Oct 31, 2019
  2. added this to the Unplanned milestone on Oct 31, 2019
  3. gopherbot commented on Oct 31, 2019

    @gopherbot
    Contributor

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

  4. locked and limited conversation to collaborators on Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeSuggestedIssues that may be good for new contributors looking for work to do.help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions