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
package p
func f(i interface{}) {
switch i.(type) {
case int:
println("int")
fallthrough
default:
println("other")
}
}
The 1.17 error message explains what's wrong with this program: fallthrough cannot be used in a type switch:
$ go version
go version go1.17.8 linux/amd64
$ go build test.go
./test.go:7:3: cannot fallthrough in type switch
The tip compiler, on the other hand, doesn't:
$ gotip version
go version devel go1.19-7dc6c5ec34 Mon Mar 7 18:19:44 2022 +0000 linux/amd64
$ gotip build test.go
./test.go:7:3: fallthrough statement out of place
1.18rc1 is also affected. Tentatively putting in the 1.19 milestone since it may be too late for 1.18.
Straight-forward to fix but at this point we're just making release blocker changes. 1.19 is good.
griesemer
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Mar 7, 2022
The 1.17 error message explains what's wrong with this program:
fallthrough
cannot be used in a type switch:The tip compiler, on the other hand, doesn't:
1.18rc1 is also affected. Tentatively putting in the 1.19 milestone since it may be too late for 1.18.
cc @griesemer @findleyr
The text was updated successfully, but these errors were encountered: