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: panic for cyclic generic interfaces #56045

Open
griesemer opened this issue Oct 4, 2022 · 0 comments
Open

cmd/compile: panic for cyclic generic interfaces #56045

griesemer opened this issue Oct 4, 2022 · 0 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

griesemer commented Oct 4, 2022

package p

type I[R any] interface{ m() R }
type J I[interface{ J }]

causes a type-checker panic:

$ go tool compile testdata/manual.go 
<unknown line number>: internal compiler error: panic: nil underlying

goroutine 1 [running]:
runtime/debug.Stack()
        /Users/gri/goroot/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x0?, 0x0?}, {0x1980893, 0x9}, {0xc0000c9d98, 0x1, 0x1})
        /Users/gri/goroot/src/cmd/compile/internal/base/print.go:227 +0x1d7
cmd/compile/internal/base.Fatalf(...)
        /Users/gri/goroot/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/gc.handlePanic()
        /Users/gri/goroot/src/cmd/compile/internal/gc/main.go:49 +0x95
panic({0x18eab80, 0x1aa3cc8})
        /Users/gri/goroot/src/runtime/panic.go:884 +0x213
cmd/compile/internal/types2.(*Checker).handleBailout(0xc0003be000, 0xc0000cb0d8)
        /Users/gri/goroot/src/cmd/compile/internal/types2/check.go:294 +0x8b
panic({0x18eab80, 0x1aa3cc8})
        /Users/gri/goroot/src/runtime/panic.go:884 +0x213
cmd/compile/internal/types2.(*Named).under(0xc00039b7a0)
        /Users/gri/goroot/src/cmd/compile/internal/types2/named.go:494 +0x3a5
...

(reported by @mdempsky)

@griesemer griesemer added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 4, 2022
@griesemer griesemer added this to the Backlog milestone Oct 4, 2022
@griesemer griesemer changed the title go/types, types2: panic for cyclic generic interfaces cmd/compile: panic for cyclic generic interfaces Oct 4, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Todo
Development

No branches or pull requests

3 participants