Closed antiraum closed 10 months ago
I have a case where the redundantReturn rule falsely removes the return statements of consecutive if statements (swift version 5.9):
Mirror(reflecting: self).children.compactMap { child -> String? in if let intValue = child.value as? Int, intValue == 0 { return nil } if let label = child.label { return "\(label): \(child.value)" } else { return "\(child.value)" } }.joined(separator: ", ")
is transformed to
Mirror(reflecting: self).children.compactMap { child -> String? in if let intValue = child.value as? Int, intValue == 0 { nil } if let label = child.label { "\(label): \(child.value)" } else { "\(child.value)" } }.joined(separator: ", ")
which isn't valid.
@antiraum thanks for reporting - I'll get it fixed asap
@antiraum fixed in 0.52.6
ahhh, thanks for the fix @nicklockwood!
thanks for the quick fix
I have a case where the redundantReturn rule falsely removes the return statements of consecutive if statements (swift version 5.9):
is transformed to
which isn't valid.