]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile, go/types: typechecking of range over int, func
authorRuss Cox <rsc@golang.org>
Wed, 14 Jun 2023 13:52:44 +0000 (09:52 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 20 Sep 2023 14:52:29 +0000 (14:52 +0000)
commit8b727f856ebc812225f2a68c3b284dfabf6472a1
treecb0caa670f868c7d9164707f9b0fc4cff086f1c4
parentfd54185a8d4e91eb6b34a73360cef0c51eea797e
cmd/compile, go/types: typechecking of range over int, func

Add type-checking logic for range over integers and functions,
behind GOEXPERIMENT=range.

For proposal #61405 (but behind a GOEXPERIMENT).
For #61717.

Change-Id: Ibf78cf381798b450dbe05eb922df82af2b009403
Reviewed-on: https://go-review.googlesource.com/c/go/+/510537
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
16 files changed:
src/cmd/compile/internal/types2/check_test.go
src/cmd/compile/internal/types2/stdlib_test.go
src/cmd/compile/internal/types2/stmt.go
src/go/build/deps_test.go
src/go/types/check_test.go
src/go/types/stdlib_test.go
src/go/types/stmt.go
src/internal/goexperiment/exp_newinliner_off.go
src/internal/goexperiment/exp_newinliner_on.go
src/internal/goexperiment/exp_range_off.go [new file with mode: 0644]
src/internal/goexperiment/exp_range_on.go [new file with mode: 0644]
src/internal/goexperiment/flags.go
src/internal/types/errors/codes.go
src/internal/types/testdata/check/stmt0.go
src/internal/types/testdata/spec/range.go [new file with mode: 0644]
test/range2.go [new file with mode: 0644]