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/vet, x/tools/internal/versions: fix interpretation of empty language version #66007

Closed
timothy-king opened this issue Feb 28, 2024 · 4 comments
Assignees
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@timothy-king
Copy link
Contributor

x/tools/internal/versions currently interprets invalid/unknown language versions ("") as some unknown earliest version. go/types interprets an unknown language version as "an empty string disables Go language version checks" and treats this as if all language features are allowed. This is closer to treating this as if it is some unknown future version. x/tools should be consistent with go/types.

Users of internal/versions x/tools/go/analysis/passes/loopclosure and x/tools/go/ssa need to update their interpretation.

Related #65612.

@timothy-king timothy-king added NeedsFix The path to resolution is known, but the work has not been done. Analysis Issues related to static analysis (vet, x/tools/go/analysis) labels Feb 28, 2024
@timothy-king timothy-king added this to the Go1.22.1 milestone Feb 28, 2024
@timothy-king timothy-king self-assigned this Feb 28, 2024
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 28, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/567635 mentions this issue: internal/versions: updates the meaning of FileVersions.

@dmitshur
Copy link
Contributor

dmitshur commented Feb 28, 2024

@timothy-king This issue is described to be for x/tools. Was it added to Go1.22.1 milestone by mistake, and can be Unreleased instead? Thanks.

@timothy-king
Copy link
Contributor Author

timothy-king commented Feb 28, 2024

It probably should be cherry picked into cmd/vet as a bug fix.

@dmitshur
Copy link
Contributor

Ok, that involves more steps, please see https://go.dev/wiki/MinorReleases.
Since this is the main tracking issue, let's move it to the Go1.23 milestone.

@dmitshur dmitshur modified the milestones: Go1.22.1, Go1.23 Feb 28, 2024
@dmitshur dmitshur changed the title x/tools/internal/versions: fix interpretation of empty language version cmd/vet, x/tools/internal/versions: fix interpretation of empty language version Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants