Hi,
this thread had me wonder again about a spec question that recently came up which I didn't have an answer to: Where does the spec say, which recursive type declarations are allowed and which aren't? For example, why is `type T *T` legal, but `type T T`¹ isn't?
To be clear: I know why we can't make `type T T` et al. legal - the compiler needs to know the size of the values and it can't know it from a declaration like `type T T`. I'm wondering how this follows from the spec.
I haven't read through all of the spec in a while, so I might just be missing an obvious section. But it doesn't seem to be described in the
section about type declarations and some obvious keyword searches like "recursive" or "size" didn't turn up anything meaningful, as far as I can tell. But feel free to point me to a section I overlooked, and apologies if the question makes me seem lazy because it ends up being obvious :)
[1] Maybe `type T struct { T }` is a better example, as it's a type-literal, not a type name - just like `type T *T`.