I wonder if this recursive structure should fail to compile:
struct S {
var x: InlineArray<1, S>
}
// or similar via intermediate types (S->D->S)
to make it aligned with other cases of recursive structures that fail to compile.
OTOH, unless I use it (say, make an instance of it, which I can't (unsafe bit casting aside)) it's probably benign to leave it compilable... But then it raises a similar question about consistency with the other cases of recursive structures (maybe they should compile, and fail to compile only if I were actually using them?)
This doesn’t seem like a stable configuration for 6.2.3 compilation, at least in SwiftFiddle, where the function swift::irgen::projectPhysicalStructMemberFromExplosion(swift::irgen::IRGenFunction&, swift::SILType, swift::irgen::Explosion&, swift::VarDecl*, swift::irgen::Explosion&) crashed during IR emission for the getter of x: @$s4main1SV1xs11InlineArrayVy$0_ACGvg.
This doesn’t feel like a reasonable compilation and so should probably be obstructed before SIL gen especially since detecting potential pointer circular references could be the cost of traversing the entire polydimensional structure which could be created by this unconstrained structuring which can grow “infinitely” outwards which would be a pain for anyone to traverse through or use in any useful capacity. Since any safe checks on these structures would be detrimental to performance the compiler should likely not try to deal with atrociously defined structures which it would have to enforce safety guarantees onto.