Skip to content

Commit 9ac5fa9

Browse files
committed
Update for Swift 6
1 parent e6daddb commit 9ac5fa9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/apple/swift-syntax.git",
77
"state": {
88
"branch": null,
9-
"revision": "08a2f0a9a30e0f705f79c9cfaca1f68b71bdc775",
10-
"version": "510.0.0"
9+
"revision": "0687f71944021d616d34d922343dcef086855920",
10+
"version": "600.0.1"
1111
}
1212
}
1313
]

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
.library(name: "Hatch", targets: ["Hatch"]),
1919
],
2020
dependencies: [
21-
.package(name: "swift-syntax", url: "https://github.com/apple/swift-syntax.git", from: "510.0.0")
21+
.package(name: "swift-syntax", url: "https://github.com/apple/swift-syntax.git", from: "600.0.0")
2222
],
2323
targets: [
2424
.executableTarget(name: "HatchExample", dependencies: [.target(name: "Hatch")]),

Sources/Hatch/StringBuilder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Foundation
2222
///
2323
/// try myFile.write(toFile: "myFile.swift", atomically: true, encoding: .utf8)
2424
/// ```
25-
@resultBuilder public struct StringBuilder {
25+
@resultBuilder public struct StringBuilder: Sendable {
2626
static public func buildBlock(_ components: String?...) -> String? {
2727
return components.compactMap { $0 }.joined(separator: "\n")
2828
}

Sources/Hatch/Symbol.swift

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import Foundation
33
// MARK: - Symbol Protocol
44

55
/// Represents a Swift type or symbol
6-
public protocol Symbol {
6+
public protocol Symbol: Sendable {
77
var children: [Symbol] { get }
88
}
99

1010
/// Represent a Swift type that can inherit from or conform to other types
11-
public protocol InheritingSymbol {
11+
public protocol InheritingSymbol: Sendable {
1212
var name: String { get }
1313
var inheritedTypes: [String] { get }
1414
}
@@ -18,60 +18,60 @@ public protocol InheritingSymbol {
1818
/// A swift protocol
1919
public typealias ProtocolType = Protocol
2020

21-
public struct Protocol: Symbol, InheritingSymbol {
21+
public struct Protocol: Symbol, InheritingSymbol, Sendable {
2222
public let name: String
2323
public let children: [Symbol]
2424
public let inheritedTypes: [String]
2525
}
2626

2727
/// A swift class
28-
public struct Class: Symbol, InheritingSymbol {
28+
public struct Class: Symbol, InheritingSymbol, Sendable {
2929
public let name: String
3030
public let children: [Symbol]
3131
public let inheritedTypes: [String]
3232
}
3333

3434
/// A swift actor
35-
public struct Actor: Symbol, InheritingSymbol {
35+
public struct Actor: Symbol, InheritingSymbol, Sendable {
3636
public let name: String
3737
public let children: [Symbol]
3838
public let inheritedTypes: [String]
3939
}
4040

4141
/// A swift struct
42-
public struct Struct: Symbol, InheritingSymbol {
42+
public struct Struct: Symbol, InheritingSymbol, Sendable {
4343
public let name: String
4444
public let children: [Symbol]
4545
public let inheritedTypes: [String]
4646
}
4747

4848
/// A swift enum
49-
public struct Enum: Symbol, InheritingSymbol {
49+
public struct Enum: Symbol, InheritingSymbol, Sendable {
5050
public let name: String
5151
public let children: [Symbol]
5252
public let inheritedTypes: [String]
5353
}
5454

5555
/// A single case of a swift enum
56-
public struct EnumCase: Symbol {
56+
public struct EnumCase: Symbol, Sendable {
5757
public let children: [Symbol]
5858
}
5959

6060
/// A single element of a swift enum case
61-
public struct EnumCaseElement: Symbol {
61+
public struct EnumCaseElement: Symbol, Sendable {
6262
public let name: String
6363
public let children: [Symbol]
6464
}
6565

6666
/// A swift typealias to an existing type
67-
public struct Typealias: Symbol {
67+
public struct Typealias: Symbol, Sendable {
6868
public let name: String
6969
public let existingType: String
7070
public let children: [Symbol] = []
7171
}
7272

7373
/// A swift extension
74-
public struct Extension: Symbol, InheritingSymbol {
74+
public struct Extension: Symbol, InheritingSymbol, Sendable {
7575
public let name: String
7676
public let children: [Symbol]
7777
public let inheritedTypes: [String]

0 commit comments

Comments
 (0)