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 0.54.0, we're facing an issue where an invalid self. prefix is added a variable reference.
In our example, we're retrieving a view model from the environment and are using @Bindable inside the view to get a bindable reference, like in the following example:
What happens with SwiftFormat 0.54.0, the redundantSelf rule now inserts a self. before the $viewModel.navigationPath which results in the following code:
I have investigated this once more and found out that the issue only occurs if the @Bindable variable definition is not at the same nesting level as the variable use. So while the code example I provided in the original post does not seem to trigger the issue, the following does:
After updating to SwiftFormat 0.54.0, we're facing an issue where an invalid
self.
prefix is added a variable reference.In our example, we're retrieving a view model from the environment and are using
@Bindable
inside the view to get a bindable reference, like in the following example:What happens with SwiftFormat 0.54.0, the
redundantSelf
rule now inserts aself.
before the$viewModel.navigationPath
which results in the following code:Unfortunately, as
self.viewModel
is not aBinding
, the compilation fails. The issue does not occur with SwiftFormat 0.53.10.The text was updated successfully, but these errors were encountered: