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: need better mechanism to control lang version for tests #49074

Closed
griesemer opened this issue Oct 19, 2021 · 2 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

Currently, the type checker uses two mechanisms to control the syntax and language version in tests: A test file may use the file extension .go2 which (at least for types2) enables type parameters in the syntax. A test package may also use an artificial package name (such as go1_12) to indicate to the type checker what -lang version to use for type-checking the package.

We may want to have a better mechanism to control this. We should probably use the ending .go (or .src) and always parse generic syntax. And perhaps we can use a comment mechanism (comment on first line) to control the -lang and other settings in a more systematic way.

Not urgent, but would be nice to address, possibly even during the freeze as it will affect tests only.

@griesemer griesemer added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 19, 2021
@griesemer griesemer added this to the Go1.18 milestone Oct 19, 2021
@griesemer griesemer self-assigned this Oct 19, 2021
@gopherbot
Copy link

Change https://golang.org/cl/357050 mentions this issue: go/types, types2: always accept type parameters when running Manual test

gopherbot pushed a commit that referenced this issue Oct 19, 2021
This makes it easier to run tests on existing generic code that is
not using the `.go2` ending currently used by type checker tests.

For #49074.

Change-Id: I1501463c55dbe1d709918786e1a43b6d1bf1629a
Reviewed-on: https://go-review.googlesource.com/c/go/+/357050
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
@griesemer griesemer modified the milestones: Go1.18, Go1.19 Jan 6, 2022
@gopherbot
Copy link

Change https://go.dev/cl/393514 mentions this issue: go/types, types2: implement flexible flag-setting mechanism for tests

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants