go/types: missing error on an edge-case with continue/break with labels #70974
Open
Description
Once again, because i am poking around with go/types
internals, i have spotted a bug in the type-checker.
The code below type-checks without any error:
package test
func test() {
outer:
for range "aa" {
break outer
}
for range "aa" {
break outer
}
}
This happens because lstmt
:
Line 169 in b9955f0
is assigned and never cleared, thus:
Lines 234 to 236 in b9955f0
is executed with a wrong label (for the second for statement).