-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: provide configuration support for different language versions #31793
Comments
If we remove such a configuration flag, we can enable the test |
Relevant compiler tests:
|
Change https://golang.org/cl/289509 mentions this issue: |
…e 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: Robert Findley <rfindley@google.com>
Change https://golang.org/cl/289570 mentions this issue: |
…s go1.9 Add respective check to type checker. Remove respective check from the compiler's new type2-based noder. Updates #31793. Change-Id: I907e3acab4c136027a8c3db1e9bac301d209c2e1 Reviewed-on: https://go-review.googlesource.com/c/go/+/289570 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Change https://golang.org/cl/290911 mentions this issue: |
…terfaces requires go1.14 Add respective check to type checker. Enables another excluded test in test/run.go. This CL completes the currently required checks for language compatibility in types2. Updates #31793. Change-Id: Icececff9e6023d38f600c93bcb54cdcafcf501b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/290911 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Change https://golang.org/cl/291317 mentions this issue: |
Change https://golang.org/cl/291319 mentions this issue: |
Change https://golang.org/cl/291318 mentions this issue: |
This is a port of CL 289509 to go/types. It differs from that CL in codes added to errors, to fit the new factoring of check_test.go, and to allow go/types to import regexp in deps_test.go For #31793 Change-Id: Ia9e4c7f5aac1493001189184227c2ebc79a76e77 Reviewed-on: https://go-review.googlesource.com/c/go/+/291317 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This is a port of CL 289570 to go/types. It has some notable differences with that CL: + A new _BadDecl error code is added, to indicate declarations with bad syntax. + declInfo is updated hold not an 'alias' bool, but an aliasPos token.Pos to identify the location of the type aliasing '=' token. This allows for error messages to be accurately placed on the '=' For #31793 Change-Id: Ib15969f9cd5be30228b7a4c6406f978d6fc58018 Reviewed-on: https://go-review.googlesource.com/c/go/+/291318 Trust: Robert Findley <rfindley@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This is an exact port of CL 290911 to go/types. For #31793 Change-Id: I28c42727735f467a5984594b455ca58ab3375591 Reviewed-on: https://go-review.googlesource.com/c/go/+/291319 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
With the reverse merge of |
go/types accepts the latest language spec. The compiler (cmd/compile) has a
-lang
flag to control the accepted language. Specifically, with-lang=go1.12
, the new language features introduced with Go 1.13 are not supported. See #31747 .Do we need an equivalent "flag" (Config field) to control the accepted language by go/types?
cc: @rsc
The text was updated successfully, but these errors were encountered: