Open elagergren-spideroak opened 6 years ago
This is now https://github.com/golang/go/issues/26863
@dominikh appreciate it.
package p
type A[P any] [1]P
type B[P any] A[P]
type C /* ERROR "invalid recursive type" */ B[C]
is similar problem?
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020460388 stack=[0xc020460000, 0xc040460000]
fatal error: stack overflow
runtime stack:
runtime.throw({0xdf97fc?, 0x1?})
runtime/panic.go:1023 +0x5c fp=0xc000073dd0 sp=0xc000073da0 pc=0x446dfc
runtime.newstack()
runtime/stack.go:1103 +0x79b fp=0xc000073fc8 sp=0xc000073dd0 pc=0x463b1b
runtime.morestack()
runtime/asm_amd64.s:616 +0x7a fp=0xc000073fd0 sp=0xc000073fc8 pc=0x48155a
goroutine 1 gp=0xc0000061c0 m=3 mp=0xc00005f008 [running]:
cmd/compile/internal/types2.(*Named).Underlying(0xc0000deee0?)
cmd/compile/internal/types2/named.go:457 +0x5a fp=0xc020460398 sp=0xc020460390 pc=0xc50a3a
cmd/compile/internal/noder.isNotInHeap({0xf5b1a8?, 0xc0000deee0?})
...
@qarmin that is a bug in Go 1.22 that is fixed in Go 1.23.
Not entirely sure if this is a bug in your SSA package or x/tools/go/types, but this interface causes a stack overflow:
A snippet of the stack: