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: switching over channel value incorrectly does not match when the direction is narrower in the case #67190
Comments
cc @golang/compiler |
The behavior changed from 1.19 to 1.20. |
I'll send a fix |
Ok so the bug, this code assumes that the type of the case can't be assigned to the type of the tag it needs to compared with ch1 := make(chan struct{})
var ch2 <-chan struct{} = ch1
fmt.Println("Equal:", ch1 == ch2)
fmt.Println("any Equal:", any(ch1) == any(ch2)) prints |
It looks like the any compare behavior is correct:
so TIL https://gophers.slack.com/archives/C1C1YSQBT/p1714960380488909 |
Possibly duplicate of #44051 |
I don't think so, here I'm assuming the behavior seen in #44051 is correct and not a bug yet this is still broken. |
Change https://go.dev/cl/583395 mentions this issue: |
Needs more changes in |
Go version
go version devel go1.23-619b419a4b Sun May 5 00:26:04 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
@LeaBit
on discord gophers report this behavior:What did you see happen?
What did you expect to see?
The text was updated successfully, but these errors were encountered: