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: //go:build file version ignored when using generic function from package "slices" in Go 1.21 [1.21 backport] #66326

Closed
gopherbot opened this issue Mar 15, 2024 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link

@cherrymui requested issue #66064 to be considered for backport to the next 1.21 minor release.

@gopherbot please backport this to Go 1.21 release. This causes build failure for valid Go code. We'll re-apply CL 571075.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Mar 15, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Mar 15, 2024
@gopherbot gopherbot added this to the Go1.21.9 milestone Mar 15, 2024
@dr2chase dr2chase added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Mar 20, 2024
@dr2chase
Copy link
Contributor

In the weekly release meeting, we think this is the re-fix following the rollback of the CL accidentally applied to a frozen tree, therefore, we approved it already once before.

@gopherbot
Copy link
Author

Change https://go.dev/cl/574736 mentions this issue: [release-branch.go1.21] go/types, types2: don't do version checks for embedded types of imported interfaces

gopherbot pushed a commit that referenced this issue Mar 27, 2024
… embedded types of imported interfaces

[This is a re-apply of CL 571075]

Imported interfaces don't have position information for embedded types.
When computing the type set of such interfaces, doing a version check
may fail because it will rely on the Go version of the current package.

We must not do a version check for features of types from imported
packages - those types have already been typechecked and are "correct".
The version check code does look at packages to avoid such incorrect
version checks, but we don't have the package information available
in an interface type (divorced from its object).

Instead, for now rely on the fact that imported interfaces don't have
position information for embedded types: if the position is unknown,
don't do a version check.

We may want to assert that positions are known in all other cases,
but since this is an older release, don't add such additional changes
to avoid introducing other bugs.

Fixes #66326.
Updates #66064.

Change-Id: I158cf51aa382f85d612ab958ba4b591de1c5fdb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/574736
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Author

Closed by merging efb7cc4 to release-branch.go1.21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

2 participants