Skip to content

Commit

Permalink
Fix strongifiedSelf being applied to non-conditional self
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed May 18, 2024
1 parent 9f06cd9 commit f5f5645
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Rules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4917,7 +4917,8 @@ public struct _FormatRules {
guard formatter.options.swiftVersion >= "4.2",
let equalIndex = formatter.index(of: .nonSpaceOrCommentOrLinebreak, after: i, if: {
$0 == .operator("=", .infix)
}), formatter.next(.nonSpaceOrCommentOrLinebreak, after: equalIndex) == .identifier("self")
}), formatter.next(.nonSpaceOrCommentOrLinebreak, after: equalIndex) == .identifier("self"),
formatter.isConditionalStatement(at: i)
else {
return
}
Expand Down

0 comments on commit f5f5645

Please sign in to comment.