-
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
go/types, x/tools/go/ssa: panic: type param without replacement encountered #63260
Comments
Reproducer: Running on 1.21 yields "T false", yet on 1.20 yields "T true". Per @timothy-king all that matters in the go.mod language version, so it may relate to new unification logic. Note that if you comment out the inferred use in main, you get "T true" again. CC @griesemer -- this is a go/types bug. |
My guess: something in the new unification logic is mutating the generic type. |
Type inference does parameter renaming. It may record the renamed type parameters. |
Change https://go.dev/cl/532157 mentions this issue: |
@gopherbot please consider this for backport to 1.21.3. This is a type-checker bug. |
Backport issue(s) opened: #63339 (for 1.21). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Moving this to the Go 1.22 milestone to track the fix at tip, and copying @findleyr's release-blocker label to the backport issue (which now tracks the fix for Go 1.21.3). Please feel free to remove that label if it's no longer needed. (Edit: Sorry for initially CCing you Robin.) |
Run
ssa.(*Program).Build
on this module (for us, via govulncheck):go.mod
, does not reproduce with go 1.20:main.go
, simplified from real code:Result:
panic: type param without replacement encountered
Reproduced with x/tools v0.13.0 and master as of Sep 27, 2023.
cc @alandonovan
The text was updated successfully, but these errors were encountered: