Skip to content

Commit

Permalink
Mark SQLError as Sendable
Browse files Browse the repository at this point in the history
It is.

(cherry picked from commit cc09c1d)
  • Loading branch information
helje5 committed Oct 18, 2024
1 parent 211a515 commit cc4b9c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Created by Helge Heß.
// Copyright © 2022 ZeeZide GmbH.
// Copyright © 2022-2024 ZeeZide GmbH.
//

import LighterCodeGenAST
Expand Down Expand Up @@ -194,7 +194,9 @@ extension EnlighterASTGenerator {
func generateSQLError(name: String = "SQLError") -> Struct {
return Struct(
public: options.public, name: name,
conformances: [.name("Swift.Error"), .name("Equatable")],
conformances: [
.name("Swift.Error"), .name("Equatable"), .name("Sendable")
],
variables: [
.let(public: options.public, "code" , .int32,
comment: "The SQLite3 error code (`sqlite3_errcode`)."),
Expand Down
5 changes: 4 additions & 1 deletion Sources/Lighter/Utilities/SQLError.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Created by Helge Heß.
// Copyright © 2022-2023 ZeeZide GmbH.
// Copyright © 2022-2024 ZeeZide GmbH.
//

import func SQLite3.sqlite3_errcode
Expand Down Expand Up @@ -50,3 +50,6 @@ public struct SQLError: Swift.Error, Equatable {
self.message = sqlite3_errmsg(db).flatMap(String.init(cString:))
}
}
#if swift(>=5.5)
extension SQLError: Sendable {}
#endif

0 comments on commit cc4b9c2

Please sign in to comment.