diff --git a/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift b/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift index 070de11a5..925bcc501 100644 --- a/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift +++ b/Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift @@ -511,9 +511,9 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor { /// Arranges the `async` and `throws` effect specifiers of a function or accessor declaration. private func arrangeEffectSpecifiers(_ node: Node) { before(node.asyncSpecifier, tokens: .break) - before(node.throwsSpecifier, tokens: .break) + before(node.throwsClause?.throwsSpecifier, tokens: .break) // Keep them together if both `async` and `throws` are present. - if let asyncSpecifier = node.asyncSpecifier, let throwsSpecifier = node.throwsSpecifier { + if let asyncSpecifier = node.asyncSpecifier, let throwsSpecifier = node.throwsClause?.throwsSpecifier { before(asyncSpecifier, tokens: .open) after(throwsSpecifier, tokens: .close) } diff --git a/Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift b/Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift index e3d4e2444..970e18ba3 100644 --- a/Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift +++ b/Sources/SwiftFormat/Rules/UseSynthesizedInitializer.swift @@ -36,7 +36,7 @@ public final class UseSynthesizedInitializer: SyntaxLintRule { // Collect any possible redundant initializers into a list } else if let initDecl = member.as(InitializerDeclSyntax.self) { guard initDecl.optionalMark == nil else { continue } - guard initDecl.signature.effectSpecifiers?.throwsSpecifier == nil else { continue } + guard initDecl.signature.effectSpecifiers?.throwsClause?.throwsSpecifier == nil else { continue } initializers.append(initDecl) } } diff --git a/Sources/SwiftFormat/Rules/ValidateDocumentationComments.swift b/Sources/SwiftFormat/Rules/ValidateDocumentationComments.swift index 95c6c1238..8bb5b117b 100644 --- a/Sources/SwiftFormat/Rules/ValidateDocumentationComments.swift +++ b/Sources/SwiftFormat/Rules/ValidateDocumentationComments.swift @@ -62,7 +62,7 @@ public final class ValidateDocumentationComments: SyntaxLintRule { } validateThrows( - signature.effectSpecifiers?.throwsSpecifier, + signature.effectSpecifiers?.throwsClause?.throwsSpecifier, name: name, throwsDescription: docComment.throws, node: node)