Open richardwilkes opened 1 week ago
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
I should note that while rearranging the code fixes the problem, if the definitions are in different files (which happens to be the case for my real code, since a bunch of different types are used in the interface definition, i.e. something more like:
type A interface {
*B | *D | *E | *F | *G | *H
}
then it sometimes fails and sometimes doesn't. I've yet to figure out exactly what is determining the order in that case.
CC @griesemer
Thanks for the report. Our cycle detection algorithm could use some love. cc: @timothy-king
Go version
go version go1.22.3 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
I found that this will not compile: https://go.dev/play/p/X-_09aV9wYj While just moving the declaration of the interface to after the struct definitions causes it to compile fine: https://go.dev/play/p/xic2fqhfmTi
What did you see happen?
What did you expect to see?
I expected both versions of the code to compile and run without error.