What version of Go are you using (go version)?
$ go version
go version go1.20 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
What did you do?
package main
var x = f(-1)
var y = f(64)
func f(x int) int {
return 1 << x
}
func main() {
println(x, y)
}
What did you expect to see?
Runtime error.
What did you see instead?
Compile time error.
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 envOutputWhat did you do?
What did you expect to see?
Runtime error.
What did you see instead?
Compile time error.