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: internal compiler error: assertion failed #57796

Closed
stephenafamo opened this issue Jan 13, 2023 · 1 comment
Closed

cmd/compile: internal compiler error: assertion failed #57796

stephenafamo opened this issue Jan 13, 2023 · 1 comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge

Comments

@stephenafamo
Copy link

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

go1.18.10 version
go version go1.18.10 darwin/arm64

Does this issue reproduce with the latest release?

Happens with 1.18 (I have tried with 1.18.9 and 1.18.10) but does not happen with 1.19 (tried with 1.19.3 and 1.19.5)

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/stephen/Library/Caches/go-build"
GOENV="/Users/stephen/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/stephen/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/stephen/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/stephen/sdk/go1.18.10"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/stephen/sdk/go1.18.10/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.10"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/stephen/code/minimal/go.mod"
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9d/1smj789x4r5bdjccy3tqss0c0000gn/T/go-build758039394=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran tests for https://github.com/stephenafamo/bob.

I have been able to provide a minimal example on the playground.

package main

func main() {
	_ = Table[*SelectQuery]{}
}

type SelectQuery struct{}

type Table[T any] struct{}

func (t *Table[T]) Query() *TableQuery[T] {
	return &TableQuery[T]{}
}

func (t *Table[T]) Insert() error {
	t.Query().Apply()
	return nil
}

type TableQuery[T any] struct {
	BaseQuery[*SelectQuery]
}

type BaseQuery[E any] struct {
	Expression E
}

func (b BaseQuery[E]) Apply(mods ...Mod[E]) {
	for _, mod := range mods {
		mod.Apply(b.Expression)
	}
}

type Mod[T any] interface {
	Apply(T)
}

What did you expect to see?

Compile and run the program successfully

What did you see instead?

./prog.go:16:17: internal compiler error: assertion failed

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

Go build failed.
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jan 13, 2023
@seankhliao
Copy link
Member

closing as it's fixed in the latest release (1.19)

@golang golang locked and limited conversation to collaborators Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants