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: could not import "package" (cannot import "package" (type parameter bound more than once), possibly version skew - reinstall package) [1.18 backport] #51847

Closed
gopherbot opened this issue Mar 21, 2022 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@ianlancetaylor requested issue #51836 to be considered for backport to the next 1.18 minor release.

@gopherbot Please open backport to 1.18

This seems to be a compiler error on valid code.

@gopherbot
Copy link
Author

Change https://go.dev/cl/394854 mentions this issue: cmd/compile/internal/importer: key tparams by Package instead of pkgname

@toothrot toothrot added the CherryPickApproved Used during the release process for point releases label Mar 23, 2022
@toothrot
Copy link
Contributor

Approved. This is a serious issue with no workaround.

@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Mar 23, 2022
@gopherbot
Copy link
Author

Closed by merging 69bc821 to release-branch.go1.18.

gopherbot pushed a commit that referenced this issue Apr 4, 2022
… Package instead of pkgname

The importer type param index used package name as type parameter key,
causing type parameters to be reused/overwritten if two packages in the
import graph had the same combination of (package name, declaration
name, type parameter name).

Fix this by instead using the *Package in the key.

Note: -G=3 was added to typeparam/issue51836.go, as it is necessary for
1.18 but not for tip.

For #51836
Fixes #51847

Change-Id: I881ceaf3cf7c1ab4e0835962350feb552e79b233
Reviewed-on: https://go-review.googlesource.com/c/go/+/394219
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
(cherry picked from commit fd1b590)
Reviewed-on: https://go-review.googlesource.com/c/go/+/394854
@golang golang locked and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants