I was experimenting with a type declaration generator I wrote to help learn more about the Go type system. During this, I found a class of compiler crashes which could be related.

Here is one such program:

type t0 = *t2[t3]
type t1[p any] t0
type t2[p any] t3
type t3 = t0

Which causes:

cycle to *Alias
goroutine 1 [running]:
runtime/debug.Stack()
    /Users/markfreeman/dev/go/src/runtime/debug/stack.go:26 +0x64
main.try.func1()
    /Users/markfreeman/dev/grammar/main.go:55 +0x254
panic({0x1042dba60?, 0x140003ca020?})
    /Users/markfreeman/dev/go/src/runtime/panic.go:877 +0x128
go/types.(*Checker).handleBailout(0x140001ae3c0, 0x140000edc38)
    /Users/markfreeman/dev/go/src/go/types/check.go:467 +0x94
panic({0x1042dba60?, 0x140003ca020?})
    /Users/markfreeman/dev/go/src/runtime/panic.go:877 +0x128
go/types.(*typeWriter).error(...)
    /Users/markfreeman/dev/go/src/go/types/typestring.go:110

Similar programs cause crashes for: - cycle to Array - cycle to Named - cycle to Pointer - cycle to Signature - cycle to Interface - cycle to Struct

I suspect many of these share the same underlying cause. For brevity, those programs are not included.