How can I actually use the new Swift 6.2 features?

Hey there, sorry if this is a silly question, but is it possible to start using some of the Swift 6.2 features in existing projects?

I installed the Xcode 26 beta & set it as my active Xcode, swift --version is 6.2 as expected, but I still can't seem to access any of the new symbols in the 6.2 standard library from Xcode.

Specifically, I'm attempting to check out the new Observations async sequence. (This symbol is obviously undefined in previous Swift versions.)

I also tried creating a brand new project (and playground), and Observations was still undefined.

Are there any specific build settings and/or feature flags I need to enable to try this out?

Thank you!

hi @lachenmayer, and welcome to the Swift forums. the initial implementation for the Observations type specifically wasn't merged until yesterday, so it is not in the Xcode 26 betas yet. it will presumably show up in the main & 6.2 branch development snapshots soon. some of the other 6.2 features are available by configuring the relevant 'upcoming feature' flag via build settings.

1 Like

Thanks Jamie! Will keep an eye out.

It works with the linux nightly docker version of swift 6.2 now - using a file named test.swift with Observerations this works:

docker run --rm -v "$PWD:/home" -w /home -ti swiftlang/swift:nightly-main swift -swift-version 6 test.swift

but with the macOS native one it does not work with snapshot main-snapshot-2025-06-20 it works compiling but crashes with an unknown symbol when running:

swiftly run swift -Xfrontend -disable-availability-checking -swift-version 6 test.swift

swiftly install 6.2-snapshot
swiftly use 6.2-snapshot

maybe it's me, but I'm trying the snapshots every day and the newest:
6.2-snapshot-2025-07-17 (in use) (default)

compiles fine, but crashes using Observations:

swiftly run swift -Xfrontend -disable-availability-checking  test.swift                                                     (16:38:15)
a contacts:
Failed to look up symbolic reference at 0x11baa435d - offset 1083 - symbol <unknown> in <unknown> - pointer at 0x11baa4798 is likely a reference to a missing weak symbol
Stack dump:
0.	Program arguments: /Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/bin/swift-frontend -frontend -interpret test.swift -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -color-diagnostics -Xcc -fcolor-diagnostics -disable-availability-checking -empty-abi-descriptor -no-auto-bridging-header-chaining -module-name test -in-process-plugin-server-path /Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 26.0 -target-sdk-name macosx26.0 -external-plugin-path /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -- test.swift
1.	Apple Swift version 6.2-dev (LLVM 0bbdf73817e84bd, Swift 5797130e90a66c5)
2.	Compiling with effective version 5.10
3.	While running user code "test.swift"
 #0 0x0000000107b09160 (/Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/bin/swift-frontend+0x1059d9160)
 #1 0x0000000107b0788c (/Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/bin/swift-frontend+0x1059d788c)
 #2 0x0000000107b097a8 (/Users/jolly/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a.xctoolchain/usr/bin/swift-frontend+0x1059d97a8)
 #3 0x000000018f8aa704 (/usr/lib/system/libsystem_platform.dylib+0x1804ce704)
.
.
.

using container/docker works:

container run --rm -v "$PWD:/home" -w /home -ti swiftlang/swift:nightly-main swift -swift-version 6 test.swift                                                                                                                     (16:42:50)
a contacts:                      
contacts controller got change:Charlie, Alice, Bob
b contacts:Charlie, Alice, Bob

On macOS opensource toolchains come with assertions enabled. For some reason on Linux that is not the case: Can we get consistent assertion behavior in the latest release Swift compiler across host platforms? - #5 by woody_melling

Success in beta 4 it works now.

1 Like

Sorry if I am asking something trivial, but where can one see what changed in the last snapshot?

i would expect there are no release notes for nightly snapshots so 'git log' is is probaly your only way to see that. I was just doing a 'swiftly update;swiftly run ....' every morning and evening to see if it had been fixed.