Runtime crash when compiling with Swift 6 and running on Swift 5.X runtime #74333
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
Using the version of Swift 6 bundled with Xcode 16 beta 1, the following two snippets of code compile and run fine in iOS 18 (sim/device) and macOS 15, but crash when run in iOS 17 (sim/device) and macOS 14.
Filing as the same issue as I believe they can be related. If not, please let me know and I'll open separate issues.
UPDATE: I wanted to see if this was an issue only with the build of Swift bundled with Xcode 16 beta 1, so I installed the newest and the oldest snapshots of the
release/6.0
train from https://www.swift.org/install/macos/ and ran code with Xcode 15.4, confirming the same crash is present in both.Oldest: Swift 6.0 Development Snapshot 2024-04-29 (a)
Newest: Swift 6.0 Development Snapshot 2024-06-11 (a)
Reproduction
Snippet 1:
Snippet 2:
Stack dump
Snippet 1:
Snippet 2:
Expected behavior
Code runs normally without crashing like when compiling with Swift 5.
Environment
Xcode 16 beta 1 (16A5171c)
swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10)
Target: arm64-apple-macosx14.0
ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79
Additional information
run with:
swiftc -g -Onone crash.swift -o crash && lldb crash -o run
The text was updated successfully, but these errors were encountered: