Swift 6.1 released with enhanced concurrency, type inference, new package traits, and more
Swift, the programming language designed for Apple's platforms, has released version 6.1, featuring multiple enhancements and bug fixes. This update notably extends the concurrency model by allowing nonisolated to be applied to types and extensions, facilitating safer concurrent API calls without @MainActor inference.
Type inference sees improvement with better handling for task groups, specifically the child task result type in withTaskGroup and withThrowingTaskGroup. A new attribute, @implementation, can now be used alongside @objc to implement declarations imported from Objective-C.
Trailing comma support has been expanded to include tuples, parameter and argument lists, generic parameter lists, closure capture lists, and string interpolations. The introduction of package traits provides new configuration capabilities, enabling different APIs and features for specific environments like Embedded Swift and WebAssembly.
Swift 6.1 also supports custom Swift Testing traits, allowing shared logic execution before or after tests. Additionally, Swift-DocC now offers a more intuitive approach for symbol link disambiguation using parameter and return type details. The release also includes other improvements and bug fixes, enhancing the overall development experience.