@@ -40,7 +40,7 @@ extension SyntaxStringInterpolation {
40
40
public protocol HasTrailingCodeBlock {
41
41
var body : CodeBlockSyntax { get set }
42
42
43
- init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) throws
43
+ init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) rethrows
44
44
}
45
45
46
46
public extension HasTrailingCodeBlock where Self: StmtSyntaxProtocol {
@@ -55,7 +55,7 @@ public extension HasTrailingCodeBlock where Self: StmtSyntaxProtocol {
55
55
}
56
56
57
57
extension CatchClauseSyntax : HasTrailingCodeBlock {
58
- public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) throws {
58
+ public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) rethrows {
59
59
self = CatchClauseSyntax ( " \( header) {} " )
60
60
self . body = try CodeBlockSyntax ( statements: bodyBuilder ( ) )
61
61
}
@@ -132,13 +132,13 @@ public extension IfExprSyntax {
132
132
self . elseKeyword = elseBody != nil ? . keyword( . else) : nil
133
133
}
134
134
135
- init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) -> CodeBlockItemListSyntax , elseIf: IfExprSyntax ) throws {
135
+ init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax , elseIf: IfExprSyntax ) throws {
136
136
let expr = ExprSyntax ( " \( header) {} " )
137
137
guard let ifExpr = expr. as ( Self . self) else {
138
138
throw SyntaxStringInterpolationError . producedInvalidNodeType ( expectedType: Self . self, actualNode: expr)
139
139
}
140
140
self = ifExpr
141
- self . body = CodeBlockSyntax ( statements: bodyBuilder ( ) )
141
+ self . body = CodeBlockSyntax ( statements: try bodyBuilder ( ) )
142
142
self . elseBody = . ifExpr( elseIf)
143
143
self . elseKeyword = elseBody != nil ? . keyword( . else) : nil
144
144
}
@@ -147,9 +147,9 @@ public extension IfExprSyntax {
147
147
// MARK: - SwitchCase
148
148
149
149
extension SwitchCaseSyntax {
150
- public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder statementsBuilder: ( ) -> CodeBlockItemListSyntax ) {
150
+ public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder statementsBuilder: ( ) throws -> CodeBlockItemListSyntax ) rethrows {
151
151
self = SwitchCaseSyntax ( " \( header) " )
152
- self . statements = statementsBuilder ( )
152
+ self . statements = try statementsBuilder ( )
153
153
}
154
154
}
155
155
0 commit comments