Skip to content

[Source compatibility suite] GRDB failing to build debug config - error: capture of 'witness' with non-sendable type 'Witness' in a '@Sendable' closure [#sendable-closure-captures] #79888

@justice-adams-apple

Description

@justice-adams-apple

Description

GRDB is failing to build the debug configuration on MacOs with the following error:

GRDB.swift/Tests/GRDBTests/DatabaseAfterNextTransactionCommitTests.swift:53:42: error: capture of 'witness' with non-sendable type 'Witness' in a '@Sendable' closure [#sendable-closure-captures]
 39 |     
 40 |     func assertTransaction_registerBefore(start startSQL: String, end endSQL: String, isNotifiedAs expectedCompletion: Database.TransactionCompletion) throws {
 41 |         class Witness { }
    |               `- note: class 'Witness' does not conform to the 'Sendable' protocol
 42 |         
 43 |         let dbQueue = try makeDatabaseQueue()
    :
 51 |                 db.afterNextTransaction { _ in
 52 |                     // use witness
 53 |                     withExtendedLifetime(witness, { })
    |                                          `- error: capture of 'witness' with non-sendable type 'Witness' in a '@Sendable' closure [#sendable-closure-captures]
 54 |                     commitCountMutex.increment()
 55 |                 }

Reproduction

swift build --disable-sandbox --package-path GRDB.swift --verbose --configuration debug --build-tests -Xswiftc -swift-version -Xswiftc 6 -Xswiftc -enable-testing

Expected behavior

Expected the project to build correctly

Environment

Apple Swift version 6.2-dev (LLVM de6bfa2f4bd7aac, Swift 80050bb)
Target: x86_64-apple-macosx10.15

Additional information

https://ci.swift.org/job/swift-main-source-compat-suite-debug/1052

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.source compatibility suiteFlag: An issue that surfaced in the source compatibility suitetriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions