You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exec go build
-- go.mod --
module test
go 1.20
-- x.go --
package x
-- x_iter.go --
//go:build go1.23 || goexperiment.rangefunc
package x
func f() {
for _ = range func(func(int) bool) {} {}
}
What did you see happen?
> exec go build
[stderr]
# test
./x_iter.go:6:16: cannot range over func(func(int) bool) {} (value of type func(func(int) bool))
[exit status 1]
FAIL: /tmp/testscript4277131041/x.txtar/script.txtar:1: unexpected command failure
What did you expect to see?
A passing test. It seems that something about the devel version causes the build logic to ignore the usual build tag conventions that suppress the error even though the go version declared in go.mod is less than the guarded version in the x_iter.go file.
If I build go from a tagged version such as go1.22.1, the test passes fine.
I verified that a commit very shortly after go1.22.1 was tagged (1653833) fails in the same way.
The text was updated successfully, but these errors were encountered:
Go version
go version devel go1.23-2ab9218c86 Mon Mar 11 22:10:38 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I ran the following testscript script:
What did you see happen?
What did you expect to see?
A passing test. It seems that something about the devel version causes the build logic to ignore the usual build tag conventions that suppress the error even though the go version declared in
go.mod
is less than the guarded version in thex_iter.go
file.If I build go from a tagged version such as go1.22.1, the test passes fine.
I verified that a commit very shortly after go1.22.1 was tagged (1653833) fails in the same way.
The text was updated successfully, but these errors were encountered: