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, types2: type parameters returned by the API should not have unresolved underlying #49788

Closed
findleyr opened this issue Nov 24, 2021 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Nov 24, 2021

With recent changes, TypeParam.Underlying() now potentially mutates the type parameter, as it lazily calculates the underlying constraint interface. This can lead to race conditions for unresolved type parameters returned from the API.

As with other lazy types, we need to ensure that all type parameters creates by type checking or with the go/types API are fully resolved when they are returned to the caller.

Relatively straightforward to fix, but needs to be a release blocker (pre-beta1).

CC @griesemer

@findleyr findleyr added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Nov 24, 2021
@findleyr findleyr added this to the Go1.18 milestone Nov 24, 2021
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/367614 mentions this issue: go/types: ensure that constructed type parameters are immutable

@golang golang locked and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants