Open
Description
Given:
package p
type s struct { i i }
type i interface { s | any }
go/types currently reports:
/tmp/y.go:3:6: invalid recursive type s
/tmp/y.go:3:6: s refers to
/tmp/y.go:4:6: i refers to
/tmp/y.go:3:6: s
Notably, changing the field type from i
to *i
makes the error go away. I don't see any fundamental reason why that should make a difference though.
Synthetic test case, constructed while trying to write additional test cases for #60117.
Activity