package main
import"fmt"funcmain() {
d:=make(map[string]string)
// I meant that to be:// for k, v := range d { ... }//// But I didn't expect it to crash a build, but get an error.for_, k, v:=ranged {
fmt.Println(k, v)
}
}
Since this will be fixed in the 1.18 release, and since the code is invalid anyhow, I don't think it's worth backporting the fix. I'm going to close this issue.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See code on Go Play.
What did you expect to see?
A proper build-time error.
What did you see instead?
A crash in the compiler:
The text was updated successfully, but these errors were encountered: