It's not a problem but a question raised in my OP. The question really boils down to what good reason is there to support this:
typedef struct {
int age;
int height;
} Person[3];
What is "this" in this case? Type alias for an array? Tagless struct type? Combined declaration for a type alias and a struct type? There are to many things piled up in the above to figure out what specifically you mean by "this".
The above is a syntactically valid construct, if only a bit too convoluted. The construct itself is perfectly useful in many contexts. There are no "quirks" in it.
The potential for abuse is there (as it is there in virtually every feature if the language), but interpreting the "abusive" code does not require any additional implementational effort from the compiler. It comes for free. The language does not refuse and does not need to refuse to support something on purely cosmetic grounds (e.g. when it just "looks too convoluted").
"this" is a typedef array for an unnamed struct. Should we ever need 1, 2, 4, 5 elements in some other part of the code one day, then we cannot unless we do one of these:
1. Change the typedef and change every declaration of it to to now be an array.
2. Copy/paste the structure into another typedef that represents a single instance of the struct.
Therefore allowing the construct in the first place is a mistake IMHO, it serves no purpose, there are other ways to do what's intended there without needing to do 1. or 2.
You claim its useful, how? show me an example of where it is more useful than some of the other options for doing this?
typedef struct {
int age;
int height;
} Person[3];
Could be:
typedef struct {
int age;
int height;
} Person;
typedef struct {
Person people[3];
} ThreePersonTeam;
For example. If that was the ONLY way to do it, what problems arise? what would one lose by disallowing the first approach?
From what I can see there's
no downside to disallowing the definition of typedef arrays, so in a new language it would be wise to do that, disallow the capability.