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/types, types2: duplicate key not detected for map composite literals with certain generic key types #51610

Closed
griesemer opened this issue Mar 11, 2022 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

func f[P int | float64]() {
	m := map[P]int{0: 1, 0.0: 2}
	fmt.Println(m)
}

should report a duplicate key: both 0 and 0.0 will be mapped to the same entry at run time

cc: findleyr

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 11, 2022
@griesemer griesemer added this to the Go1.19 milestone Mar 11, 2022
@griesemer griesemer self-assigned this Mar 11, 2022
@thepudds
Copy link
Contributor

CC @findleyr

@gopherbot
Copy link

Change https://go.dev/cl/406555 mentions this issue: types2: detect dupl. map keys in comp. literals with generic key type

@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants