-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language features
Description
Description
The Swift 6.1 compiler does not compile code that compiles with the Swift 6.0 compiler.
Reproduction
Compile the code below from Xcode 16.2 (16C5032a) with swift-6.1-DEVELOPMENT-SNAPSHOT-2025-01-13-a.xctoolchain
import Foundation
enum MyEnum: Sendable {
// Compiler error:
// Associated value 'formatted' of 'Sendable'-conforming enum 'MyEnum'
// has non-sendable type 'DateFormatter'
case formatted(DateFormatter)
nonisolated(unsafe) static let iso8601Formatter: ISO8601DateFormatter = {
fatalError()
}()
}
(Note that Foundation.DateFormatter
is declared as Sendable).
Expected behavior
The code compiles, as it does with a Swift 6.0 compiler, because it is correct.
Environment
Development Snapshots swift-6.1-DEVELOPMENT-SNAPSHOT-2025-01-13-a
Additional information
This regression was found because Swift 6.1 can not compile https://github.com/groue/GRDB.swift/tree/v7.0.0-beta.6.
This kind of regression is supposed to be caught by https://github.com/swiftlang/swift-source-compat-suite, but unfortunately this is not possible: swiftlang/swift-source-compat-suite#963 :-/
cyonix, theoks, lin72h and shimastripe
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language features