It should be possible to generate public default initializers for structs

  1. This was rejected for the reasons given here: default struct initializer internal even if class declared public - #3 by DevAndArtist. Which is not to say that I'm necessarily against revisiting the matter, just that it might be a bit of an uphill battle.
  2. Personally I'd rather see syntax more like @synthesize(init) struct Foo { ... } (or struct Foo { ... } @synthesize(init)) because that provides a place to list all the things we want the compiler to synthesize for us. Even protocol conformances could be listed there, for things which the compiler can reason out for itself (Equatable, Hashable, and Codable all come to mind, although I suppose we couldn't actually require them to be listed there since it'd be a source-breaking change).
1 Like