Skip to content

Commit 7aa13fb

Browse files
vkuttypCopilot
andcommitted
fix: remove [self] captures in @sendable closures for Swift 6.0
In Swift 6.0 strict concurrency mode, capturing 'self' (XCTestCase subclass, not Sendable) in a @sendable closure is an error/compiler crash. Remove the unnecessary [self] capture lists since self is never used in these closures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b2e64ad commit 7aa13fb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Tests/MySQLNioTests/MySQLIntegrationTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ final class MySQLBackupTests: XCTestCase {
14931493
}
14941494

14951495
func testLogicalDump() {
1496-
run { [self] in
1496+
run {
14971497
let conn = try await MySQLTestDatabase.connect()
14981498
defer { Task { try? await conn.close() } }
14991499
_ = try await conn.execute(
@@ -1509,7 +1509,7 @@ final class MySQLBackupTests: XCTestCase {
15091509
}
15101510

15111511
func testDumpAndRestoreRoundTrip() {
1512-
run { [self] in
1512+
run {
15131513
let conn = try await MySQLTestDatabase.connect()
15141514
defer { Task { try? await conn.close() } }
15151515
_ = try await conn.execute(
@@ -1530,7 +1530,7 @@ final class MySQLBackupTests: XCTestCase {
15301530
func testDumpToFile() {
15311531
let path = NSTemporaryDirectory() + "mysql_dump_\(UUID()).sql"
15321532
defer { try? FileManager.default.removeItem(atPath: path) }
1533-
run { [self] in
1533+
run {
15341534
let conn = try await MySQLTestDatabase.connect()
15351535
defer { Task { try? await conn.close() } }
15361536
_ = try await conn.execute(
@@ -1546,7 +1546,7 @@ final class MySQLBackupTests: XCTestCase {
15461546
}
15471547

15481548
func testDumpHandlesNulls() {
1549-
run { [self] in
1549+
run {
15501550
let conn = try await MySQLTestDatabase.connect()
15511551
defer { Task { try? await conn.close() } }
15521552
_ = try await conn.execute(

0 commit comments

Comments
 (0)