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, cmd/compile: type set overlapping implementation for interface types might be not correct [1.18 backport] #52119

Closed
gopherbot opened this issue Apr 2, 2022 · 3 comments
Labels
CherryPickApproved
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 2, 2022

@griesemer requested issue #51607 to be considered for backport to the next 1.18 minor release.

@gopherbot please backport to 1.18, this bug leads to confusing and misleading errors, and the fix is straight-forward.

@gopherbot gopherbot added the CherryPickCandidate label Apr 2, 2022
@gopherbot gopherbot added this to the Go1.18.1 milestone Apr 2, 2022
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 4, 2022

Change https://go.dev/cl/398154 mentions this issue: [release-branch.go1.18] go/types, types2: fix overlap test for union termlist

@cherrymui cherrymui changed the title cmd/go: type set overlapping implementation for interface types might be not correct [1.18 backport] go/types, cmd/compile: type set overlapping implementation for interface types might be not correct [1.18 backport] Apr 5, 2022
@cherrymui
Copy link
Member

@cherrymui cherrymui commented Apr 6, 2022

Approved for backport.

@cherrymui cherrymui added CherryPickApproved NeedsFix and removed CherryPickCandidate NeedsFix labels Apr 6, 2022
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 6, 2022

Closed by merging 2097b2d to release-branch.go1.18.

gopherbot pushed a commit that referenced this issue Apr 6, 2022
…termlist

Per the spec, "the type sets of all non-interface terms must be
pairwise disjoint (the pairwise intersection of the type sets must
be empty)" in a union.

For the overlap test, the existing implementation casually mixed
syntactic union terms (which may have interface type) with type set
terms (which are normalized/expanded and must not have interface
type). As a consequence, in some cases the overlap test failed.

This change skips terms with interface types in the overlap test.

For this cherry-pick, also rename the files ending in issue51607.go
to issue51607.go2 because the 1.18 branch requires tests containing
generic features to end in .go2.

Fixes #52119.

Change-Id: I8ae9953db31f0a0428389c6a45a6696aa2450219
Reviewed-on: https://go-review.googlesource.com/c/go/+/397695
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/398154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved
Projects
None yet
Development

No branches or pull requests

2 participants