diff --git a/Sources/ParsingHelpers.swift b/Sources/ParsingHelpers.swift index 1ac4456d8..e071e6e44 100644 --- a/Sources/ParsingHelpers.swift +++ b/Sources/ParsingHelpers.swift @@ -571,13 +571,7 @@ extension Formatter { } return last(.nonSpaceOrCommentOrLinebreak, before: prevIndex) != .keyword("func") default: - if let nextIndex = index(of: .nonSpaceOrCommentOrLinebreak, after: i), - isAccessorKeyword(at: nextIndex) || isAccessorKeyword(at: prevIndex) - { - return false - } else { - return !isConditionalStatement(at: startOfScope) - } + return false } fallthrough case .identifier, .number, .operator("?", .postfix), .operator("!", .postfix), diff --git a/Tests/Rules/WrapMultilineStatementBracesTests.swift b/Tests/Rules/WrapMultilineStatementBracesTests.swift index ff7ee6344..e3887018c 100644 --- a/Tests/Rules/WrapMultilineStatementBracesTests.swift +++ b/Tests/Rules/WrapMultilineStatementBracesTests.swift @@ -703,4 +703,25 @@ class WrapMultilineStatementBracesTests: XCTestCase { testFormatting(for: input, rules: [.wrapMultilineStatementBraces, .wrap], options: options, exclude: [.indent, .redundantClosure, .wrapConditionalBodies]) } + + func testWrapMultilineStatementBraceAfterWhereClauseWithTuple() { + let input = """ + extension Foo { + public func testWithWhereClause( + a: A, + b: B) + -> Outcome where + Outcome == (A, B) + { + return (a, b) + } + } + """ + + let options = FormatOptions( + wrapArguments: .beforeFirst, + closingParenPosition: .sameLine + ) + testFormatting(for: input, rules: [.wrapMultilineStatementBraces, .braces], options: options) + } }