-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: backward incompatible change in Go 1.21 type inference with channels [1.21 backport] #62205
Comments
Approved as this was a regression. |
@griesemer can the create the cherrypick cl please? |
Sorry, we don't have a correct fix for this yet. This turns out to be more tricky than anticipated. |
Change https://go.dev/cl/524256 mentions this issue: |
@joedian Once reviewed, this is ready to go. |
…inference involving channels In inexact unification, when a named type matches against an inferred unnamed type, we change the previously inferred type to the named type. This preserves the type name and assignability. We have to do the same thing when encountering a directional channel: a bidirectional channel can always be assigned to a directional channel but not the other way around. Thus, if we see a directional channel, we must choose the directional channel. This CL extends the previously existing logic for named types to directional channels and also makes the code conditional on inexact unification. The latter is an optimization - if unification is exact, type differences don't exist and updating an already inferred type has no effect. Fixes #62205. Change-Id: I807e3b9f9ab363f9ed848bdb18b2577b1d680ea7 Reviewed-on: https://go-review.googlesource.com/c/go/+/524256 Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Closed by merging b120517 to release-branch.go1.21. |
@griesemer requested issue #62157 to be considered for backport to the next 1.21 minor release.
The text was updated successfully, but these errors were encountered: