You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating to SwiftFormat versions between 0.50.6 and 0.54.0, the redundantSelf rule incorrectly removes the explicit use of self in some contexts, which leads to compilation errors. The issue appears when using properties within closures or async contexts in actor classes.
Steps to Reproduce
Define an actor with a property.
Access the property within a method, using self explicitly.
Run SwiftFormat version 0.50.6 to 0.54.0 on the codebase.
Observe the removal of self and the subsequent compilation error.
@filimo I'm guessing the argument to Logger.info() is an autoclosure or something? Unfortunately SwiftFormat can't detect this automatically so you have to manually exclude such cases using --selfrequired info
After updating to SwiftFormat versions between 0.50.6 and 0.54.0, the
redundantSelf
rule incorrectly removes the explicit use ofself
in some contexts, which leads to compilation errors. The issue appears when using properties within closures or async contexts inactor
classes.Steps to Reproduce
self
explicitly.self
and the subsequent compilation error.Example
Before running SwiftFormat:
After running SwiftFormat:
Error:
Expected Behavior
SwiftFormat should recognize the context in which
self
is necessary for property access within closures or async methods and avoid removing it.Actual Behavior
The
redundantSelf
rule removes the necessaryself
prefix, causing a compilation error.Environment
The text was updated successfully, but these errors were encountered: