{"id":46933,"date":"2025-03-03T15:34:21","date_gmt":"2025-03-03T20:34:21","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=46933"},"modified":"2025-04-01T16:25:54","modified_gmt":"2025-04-01T20:25:54","slug":"swift-6-1","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/03\/03\/swift-6-1\/","title":{"rendered":"Swift 6.1"},"content":{"rendered":"<p><a href=\"https:\/\/forums.swift.org\/t\/swift-6-1-release-process\/75442\">Mishal Shah<\/a>:<\/p>\n<blockquote cite=\"https:\/\/forums.swift.org\/t\/swift-6-1-release-process\/75442\"><p>This post describes the release process, and estimated schedule for Swift 6.1.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/www.donnywals.com\/whats-new-in-swift-6-1\/\">Donny Wals<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.donnywals.com\/whats-new-in-swift-6-1\/\"><p>The Xcode 16.3 beta is out, which includes a new version of Swift. Swift 6.1 is a relatively small release that comes with bug fixes, quality of life improvements, and some features.<\/p><p>[&#8230;]<\/p><p>Starting in Swift 6.1, Apple has made it so that we no longer have to explicitly define the return type for our child tasks. Instead, Swift can infer the return type of child tasks based on the first task that we add to the group.<\/p><p>[&#8230;]<\/p><p>However, it&rsquo;s kind of strange in a way that the compiler is using an extension on <code>Int<\/code> that&rsquo;s defined in a module that I didn&rsquo;t even import in this specific file.<\/p><p>[&#8230;]<\/p><p>In Swift 6.1, we can opt into a new member visibility mode. This member visibility mode is going to work a little bit more like you might expect.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/www.massicotte.org\/concurrency-6_1\">Matt Massicotte<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.massicotte.org\/concurrency-6_1\"><p>I really like <a href=\"https:\/\/github.com\/swiftlang\/swift-evolution\/blob\/main\/proposals\/0449-nonisolated-for-global-actor-cutoff.md\">proposals<\/a> that make things work more intuitively. What this one does is expand the use of <code>nonisolated<\/code> so you can better control global isolation inference.<\/p><p>[&#8230;]<\/p><p>I completely missed <a href=\"https:\/\/github.com\/swiftlang\/swift-evolution\/blob\/main\/proposals\/0442-allow-taskgroup-childtaskresult-type-to-be-inferred.md\">this one<\/a> when it was pitched! It&rsquo;s just a great little quality-of-life improvement for the <code>with*TaskGroup<\/code> family of APIs.<\/p><p>[&#8230;]<\/p><p>Another area that has seen attention is around the <code>sending<\/code> keyword. There were a number of situations where the compiler was too conservative with <code>sending<\/code> and 6.1 has gotten a lot better!<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/11\/25\/swift-vision-improving-the-approachability-of-data-race-safety\/\">Swift Vision: Improving the Approachability of Data-Race Safety<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/09\/19\/swift-6\/\">Swift 6<\/a><\/li>\n<\/ul>\n\n<p id=\"swift-6-1-update-2025-04-01\">Update (2025-04-01): <a href=\"https:\/\/www.swift.org\/blog\/swift-6.1-released\/\">Holly Borla<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/swift-6.1-released\/\"><p>Swift 6.1 is now available!<\/p><p>[&#8230;]<\/p><p>Swift&rsquo;s concurrency model allows writing <code>nonisolated<\/code> on properties and functions to indicate that an API is safe to call from any concurrent context. Swift 6.1 extends <code>nonisolated<\/code> to types and extensions.<\/p><p>[&#8230;]<\/p><p>Swift 6.1 includes a new attribute, <code>@implementation<\/code>, which can be used together with <code>@objc<\/code> to provide an implementation for a declaration that has been imported from Objective-C. You can write <code>@objc @implementation<\/code> on a Swift <code>extension<\/code> to replace an Objective-C <code>@implementation<\/code> block.<\/p><p>[&#8230;]<\/p><p>Swift 6.1 extends trailing comma support to tuples, parameter and argument lists, generic parameter lists, closure capture lists, and string interpolations[&#8230;]<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/04\/01\/xcode-16-3\/\">Xcode 16.3<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Mishal Shah: This post describes the release process, and estimated schedule for Swift 6.1. Donny Wals: The Xcode 16.3 beta is out, which includes a new version of Swift. Swift 6.1 is a relatively small release that comes with bug fixes, quality of life improvements, and some features.[&#8230;]Starting in Swift 6.1, Apple has made it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-03-03T20:34:23Z","apple_news_api_id":"41eec097-e583-4e35-80f5-5f4b79f70bb5","apple_news_api_modified_at":"2025-04-01T20:25:57Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AQe7Al-WDTjWA9V9LefcLtQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[46,71,2200,901],"class_list":["post-46933","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-swift-concurrency","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=46933"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46933\/revisions"}],"predecessor-version":[{"id":47274,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46933\/revisions\/47274"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=46933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=46933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=46933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}