File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ public struct SyntaxBuildableType: Hashable {
170
170
}
171
171
172
172
/// Wraps a type in an optional chaining depending on whether `isOptional` is true.
173
- public func optionalChained( expr: ExprSyntaxProtocol ) -> ExprSyntax {
173
+ public func optionalChained< ExprNode : ExprSyntaxProtocol > ( expr: ExprNode ) -> ExprSyntax {
174
174
if isOptional {
175
175
return ExprSyntax ( OptionalChainingExprSyntax ( expression: expr) )
176
176
} else {
@@ -179,7 +179,7 @@ public struct SyntaxBuildableType: Hashable {
179
179
}
180
180
181
181
/// Wraps a type in a force unwrap expression depending on whether `isOptional` is true.
182
- public func forceUnwrappedIfNeeded( expr: ExprSyntaxProtocol ) -> ExprSyntax {
182
+ public func forceUnwrappedIfNeeded< ExprNode : ExprSyntaxProtocol > ( expr: ExprNode ) -> ExprSyntax {
183
183
if isOptional {
184
184
return ExprSyntax ( ForcedValueExprSyntax ( expression: expr) )
185
185
} else {
Original file line number Diff line number Diff line change @@ -120,9 +120,11 @@ struct GenerateSwiftSyntax: ParsableCommand {
120
120
. appendingPathComponent ( template. module)
121
121
. appendingPathComponent ( " generated " )
122
122
. appendingPathComponent ( template. filename)
123
- previouslyGeneratedFilesLock. withLock {
124
- _ = previouslyGeneratedFiles. remove ( destination)
125
- }
123
+
124
+ previouslyGeneratedFilesLock. lock ( ) ;
125
+ _ = previouslyGeneratedFiles. remove ( destination)
126
+ previouslyGeneratedFilesLock. unlock ( )
127
+
126
128
try generateTemplate (
127
129
sourceFile: template. sourceFile,
128
130
destination: destination,
You can’t perform that action at this time.
0 commit comments