What version of Go are you using (go version)?
go version go1.11 windows/amd64 (also occurs under Linux or on the playground)
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
GOHOSTARCH=amd64
GOHOSTOS=windows
(also happens on playground)
What did you do?
MWE:
package main
func main() {
var append bool
append()
}
https://play.golang.org/p/Z36gAU5mgUY
What did you expect to see?
prog.go:5:9: cannot call non-function append (type bool)
What did you see instead?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0xb7c7ee]
goroutine 1 [running]:
cmd/compile/internal/gc.typecheck1(0xc00032c180, 0x1, 0xc00032c080)
/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:1270 +0x3ece
cmd/compile/internal/gc.typecheck(0xc00032c180, 0x1, 0xc00032c080)
/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckslice(0xc0003201c0, 0x3, 0x4, 0x1)
/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:68 +0x50
cmd/compile/internal/gc.Main(0xcc2180)
/usr/local/go/src/cmd/compile/internal/gc/main.go:518 +0x2059
main.main()
/usr/local/go/src/cmd/compile/main.go:51 +0x96
Spotted by @Weiss91
What version of Go are you using (
go version)?go version go1.11 windows/amd64 (also occurs under Linux or on the playground)
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?(also happens on playground)
What did you do?
MWE:
https://play.golang.org/p/Z36gAU5mgUY
What did you expect to see?
What did you see instead?
Spotted by @Weiss91