Commit 1ff2fdaa authored by Robert Griesemer's avatar Robert Griesemer
Browse files

[dev.typeparams] cmd/compile/internal/types2: add support for language version checking

Add the Config.Lang field which may be set to a Go version string,
such as "go1.12". This is a string rather than explicit semantic
version numbers (such as {1, 12}) for API robustness; a string
is more flexible should we need more or different information.

Add -lang flag to types2 package for use with (manual) testing
when running "go test -run Check$ -lang=... -files=...".

While changing flags, look for comma-separated (rather than space-
separated) files when providing the -file flag.

Check that numeric constant literals, signed shift counts are
accepted according to the selected language version.

Type alias declarations and overlapping embedded interfaces are
not yet checked.

Updates #31793.

Change-Id: I9ff238ed38a88f377eb2267dc3e8816b89a40635
Reviewed-on: https://go-review.googlesource.com/c/go/+/289509


Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarRobert Findley <rfindley@google.com>
parent 370e9f58
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment