Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: <unknown line number>: internal compiler error: panic: nil node #52887

Closed
stianhj opened this issue May 13, 2022 · 1 comment
Closed

Comments

@stianhj
Copy link

stianhj commented May 13, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18.2 linux/amd64

Tried with go1.18.1 linux/amd64 as well.

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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/stian/.cache/go-build"
GOENV="/home/stian/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/stian/code/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/stian/code/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/stian/down/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/stian/down/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4054702887=/tmp/go-build -gno-record-gcc-switches"

What did you do?

package main

func main() {
	const a = "foo"
	a += "bar"
}
$ go run main.go

What did you expect to see?

# command-line-arguments
./main.go:5:4: cannot assign to a (declared const)

(that's the output from version 1.17.4)

What did you see instead?

# command-line-arguments
<unknown line number>: internal compiler error: panic: nil node

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
@cuonglm
Copy link
Member

cuonglm commented May 13, 2022

This is fixed at tip:

$ go version
go version devel go1.19-016d755213 Thu May 12 22:32:42 2022 +0000 linux/amd64
$ go tool compile p.go 
p.go:5:2: cannot assign to a (untyped string constant "foo")

@cuonglm cuonglm closed this as completed May 13, 2022
@golang golang locked and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants