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: error message for invalid type switch cases less helpful in Go1.18 #50965

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

Comments

@griesemer
Copy link
Contributor

	var i I
	var s string

	switch i {
	case s:
	}

produces

invalid operation: cannot compare s == i (mismatched types string and I)

The compiler at 1.17 reported

invalid case s in switch on i (mismatched types string and I)
@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 2, 2022
@griesemer griesemer added this to the Go1.18 milestone Feb 2, 2022
@griesemer griesemer self-assigned this Feb 2, 2022
@gopherbot
Copy link

Change https://golang.org/cl/382354 mentions this issue: cmd/compile/internal/types2: better error messages for type switches

@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

2 participants