go/types, types2: need better mechanism to control lang version for tests #49074
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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 fortypes2
) enables type parameters in the syntax. A test package may also use an artificial package name (such asgo1_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.
The text was updated successfully, but these errors were encountered: