[Accepted with modifications] SE-0478: File-level defaults

Hi all.

The second review of SE-0478: File-level defaults ran from June 5th to 19th, 2026.

There was some discussion about whether or not such a feature is desirable at all (the LSG broadly feels that its utility outweighs the slight increase in contextual complexity when reading code), and whether or not the spelling is maybe a little bit too clever (we think that it's just clever enough and ends up reading very nicely).

We were convinced that the language generally does not enforce constraints like "this must appear at the beginning of a file", and so we have agreed with the authors to remove that requirement from the feature. As with import statements, it is probably still good style to do so even though the compiler will not require it.

SE-0478 is therefore accepted with this modification.

As always, thanks for your thoughtful contributions toward making Swift a better language.

Steve Canon
Review Manager

11 Likes