]> Cypherpunks repositories - gostls13.git/commit
go/types: add error reporting for 1.18 syntax if GoVersion is below 1.18
authorRobert Findley <rfindley@google.com>
Tue, 31 Aug 2021 18:41:29 +0000 (14:41 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 31 Aug 2021 21:22:54 +0000 (21:22 +0000)
commitb93581e47d358da9fc2d08032cd73797c2cb28a5
tree23fe890e7cd5cd1d8d4fb1cd8b7b5882abeec14e
parentaed59d172ad532bd2eedcf78ba97fdd113d2dccd
go/types: add error reporting for 1.18 syntax if GoVersion is below 1.18

This is a port of CL 344871 to go/types. Unlike the compiler, go/parser
is already always producing 1.18 syntax, so the effect of this CL is to
add some additional errors when Config.GoVersion is below 1.18.

This is a non-trivial port, both due to different error reporting APIs
and due to interacting with declaration syntax nodes, which differ
between go/ast and cmd/compile/internal/syntax.

Change-Id: I8003a014e6eec5e554c24e9a6cfc0548ec534834
Reviewed-on: https://go-review.googlesource.com/c/go/+/346433
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>
src/go/types/call.go
src/go/types/decl.go
src/go/types/resolver.go
src/go/types/subst.go
src/go/types/testdata/check/decls0.src
src/go/types/testdata/check/issues.src
src/go/types/testdata/check/main.go2
src/go/types/testdata/check/typeparams.go2
src/go/types/testdata/fixedbugs/issue47818.go2 [new file with mode: 0644]
src/go/types/typeset.go
src/go/types/typexpr.go