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.
The text was updated successfully, but these errors were encountered:
This makes it easier to run tests on existing generic code that is
not using the `.go2` ending currently used by type checker tests.
Trust: Robert Griesemer <email@example.com>
Run-TryBot: Robert Griesemer <firstname.lastname@example.org>
Reviewed-by: Robert Findley <email@example.com>
TryBot-Result: Go Bot <firstname.lastname@example.org>