Closed shkhaliq closed 9 months ago
@shkhaliq I'm having trouble reproducing this issue. When I try it with default settings the return
keywords are removed and it compiles fine. When I try it with redundantReturn
disabled, it leaves the code unaltered.
What settings are you using? Can you provide a standlone sample that formats incorrectly with those settings?
@shkhaliq, what error do you get? There are some bugs in Swift 5.9 where some otherwise well-formed if/switch expressions unexpectedly fail to compile.
Sorry this was a late night post - and yes @calda I am seeing compiler errors which has nothing to do with SwiftFormat.
I was previously seeing errors but then realized was using an outdated version of SwiftFormat
@nicklockwood any chance we can have conditionalAssignment
's behavior working even if redundantSelf
is disabled? Like, same as OP, but removing those return
statements since their presence is what causes compiler errors and they must be removed in all scenarios AFAICT. Tightly coupling 2 rules in order for 1 of them to work feels kinda hacky 😅
Thanks for your help! 🙏
@rogerluan to be clear, you aren't seeing errors, right? It's just that conditionalAssignment
isn't being applied to cases like the above unless redundantReturn
is also enabled?
I am seeing a ton of errors with conditionalAssignment rules. This is one of them
SwiftFormat Version: 0.52.11 Swift version: 5.9.2 Xcode Version: 15.1.0
I can help provide more examples if needed