]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: require iterator yield to return bool (work-around)
authorRobert Griesemer <gri@golang.org>
Tue, 7 Jan 2025 23:06:05 +0000 (15:06 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 8 Jan 2025 21:54:54 +0000 (13:54 -0800)
commitc9afcbade7308cf66b67b9ce080f10b621b17c6a
tree03d9b4554bc3bb39f72746a82775ef8fe6f3a5fe
parent54693a81fd605a9c1abbee83da072c61e38d3ebf
go/types, types2: require iterator yield to return bool (work-around)

The original implementation of the type checkers accepted any boolean
result type for yield, but the compiler's front-end had a problem with
it (#71131).

As a temporary fix (for 1.24), adjust the type checkers to insist on the
spec's literal wording and avoid the compiler panic.

Fixes #71131.
For #71164.

Change-Id: Ie25f9a892e58b5e489d399b0bce2d0af55dc3c48
Reviewed-on: https://go-review.googlesource.com/c/go/+/640599
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/universe.go
src/go/types/stmt.go
src/go/types/universe.go
src/internal/types/testdata/fixedbugs/issue71131.go [new file with mode: 0644]
src/internal/types/testdata/spec/range.go