@@ -40,7 +40,7 @@ extension SyntaxStringInterpolation {
4040public protocol HasTrailingCodeBlock {
4141 var body : CodeBlockSyntax { get set }
4242
43- init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) throws
43+ init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) rethrows
4444}
4545
4646public extension HasTrailingCodeBlock where Self: StmtSyntaxProtocol {
@@ -55,7 +55,7 @@ public extension HasTrailingCodeBlock where Self: StmtSyntaxProtocol {
5555}
5656
5757extension CatchClauseSyntax : HasTrailingCodeBlock {
58- public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) throws {
58+ public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax ) rethrows {
5959 self = CatchClauseSyntax ( " \( header) {} " )
6060 self . body = try CodeBlockSyntax ( statements: bodyBuilder ( ) )
6161 }
@@ -132,13 +132,13 @@ public extension IfExprSyntax {
132132 self . elseKeyword = elseBody != nil ? . keyword( . else) : nil
133133 }
134134
135- init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) -> CodeBlockItemListSyntax , elseIf: IfExprSyntax ) throws {
135+ init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder bodyBuilder: ( ) throws -> CodeBlockItemListSyntax , elseIf: IfExprSyntax ) throws {
136136 let expr = ExprSyntax ( " \( header) {} " )
137137 guard let ifExpr = expr. as ( Self . self) else {
138138 throw SyntaxStringInterpolationError . producedInvalidNodeType ( expectedType: Self . self, actualNode: expr)
139139 }
140140 self = ifExpr
141- self . body = CodeBlockSyntax ( statements: bodyBuilder ( ) )
141+ self . body = CodeBlockSyntax ( statements: try bodyBuilder ( ) )
142142 self . elseBody = . ifExpr( elseIf)
143143 self . elseKeyword = elseBody != nil ? . keyword( . else) : nil
144144 }
@@ -147,9 +147,9 @@ public extension IfExprSyntax {
147147// MARK: - SwitchCase
148148
149149extension SwitchCaseSyntax {
150- public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder statementsBuilder: ( ) -> CodeBlockItemListSyntax ) {
150+ public init ( _ header: PartialSyntaxNodeString , @CodeBlockItemListBuilder statementsBuilder: ( ) throws -> CodeBlockItemListSyntax ) rethrows {
151151 self = SwitchCaseSyntax ( " \( header) " )
152- self . statements = statementsBuilder ( )
152+ self . statements = try statementsBuilder ( )
153153 }
154154}
155155
0 commit comments