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
Closed
Labels
NeedsFix
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Feb 2, 2022

	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 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

@gopherbot gopherbot commented Feb 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

2 participants