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, but it works in go1.19
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/clark/.cache/go-build"
GOENV="/home/clark/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/clark/.go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/clark/.go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3340342221=/tmp/go-build -gno-record-gcc-switches"
What did you do?
GoPlay: https://go.dev/play/p/DfmO9bKkKal
go run main.go
What did you expect to see?
[clark@ArchOxO issus]$ go run main.go
true
What did you see instead?
[clark@ArchOxO issus]$ go run main.go
# command-line-arguments
./main.go:3:5: internal compiler error: Type.Elem UNION
Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes, but it works in go1.19
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
go run main.goWhat did you expect to see?
What did you see instead?