Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 6.1 regression in Sendable checking #78635

Open
groue opened this issue Jan 14, 2025 · 0 comments
Open

Swift 6.1 regression in Sendable checking #78635

groue opened this issue Jan 14, 2025 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@groue
Copy link

groue commented Jan 14, 2025

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 :-/

@groue groue added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant