Tagged: Swift Evolution
There are 11 items tagged #Swift Evolution.
And there a lots of other tags to explore.
There are 11 items tagged #Swift Evolution.
And there a lots of other tags to explore.
The any keyword makes the cost of an existential type visible. Here is what a bare protocol name was hiding, where the migration actually stands today, and how to turn the warnings on early.
DecodingError and EncodingError now print a clean one-line summary with the coding path, instead of the wall of text we used to skim past.
Swift 6 lets a function declare exactly which error type it throws. Here is the syntax, what it does to catch blocks, and why untyped throws is still the right default.
Swift 6.1 allows a trailing comma in parameter lists, tuples, generic parameters, capture lists, and more. A small change that makes diffs a lot cleaner.
Swift 5.9 lets an if or switch produce a value instead of just assigning one. It removes a var we never wanted, but the single-expression rule catches people out.
Adding a case to a public enum is a source-breaking change for anyone switching over it. Swift's @nonexhaustive attribute finally lets packages opt out of that.
Swift 6.2 adds InlineArray, a fixed-size array whose length is part of its type, along with a shorthand for writing it: [5 of Int].
Swift 6.2 adds a default: label to string interpolation, so we can provide a fallback string for any optional value without fighting the type checker.
Swift 6.2 lets us write names containing spaces, digits, and punctuation by wrapping them in backticks. Let's see where that helps.
SE-0502 changes the rules for the synthesized memberwise initializer so a private property with an initial value doesn't make the whole initializer inaccessible.
SE-0546 proposes allowing us to declare a struct's memberwise initializer in a same-file extension. Let's see how it works.
See all tags.