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 {
170170 }
171171
172172 /// 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 {
174174 if isOptional {
175175 return ExprSyntax ( OptionalChainingExprSyntax ( expression: expr) )
176176 } else {
@@ -179,7 +179,7 @@ public struct SyntaxBuildableType: Hashable {
179179 }
180180
181181 /// 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 {
183183 if isOptional {
184184 return ExprSyntax ( ForcedValueExprSyntax ( expression: expr) )
185185 } else {
Original file line number Diff line number Diff line change @@ -120,9 +120,11 @@ struct GenerateSwiftSyntax: ParsableCommand {
120120 . appendingPathComponent ( template. module)
121121 . appendingPathComponent ( " generated " )
122122 . appendingPathComponent ( template. filename)
123- previouslyGeneratedFilesLock. withLock {
124- _ = previouslyGeneratedFiles. remove ( destination)
125- }
123+
124+ previouslyGeneratedFilesLock. lock ( ) ;
125+ _ = previouslyGeneratedFiles. remove ( destination)
126+ previouslyGeneratedFilesLock. unlock ( )
127+
126128 try generateTemplate (
127129 sourceFile: template. sourceFile,
128130 destination: destination,
You can’t perform that action at this time.
0 commit comments