-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rule] Prefer let-bindings over var-bindings wherever possible #10
Comments
Wouldn't you also need to check if any mutating methods /input functions are called with it? |
Yeah, this will be a trick one. We can't also predict anything on properties from public API (they might not change inside the file itself, but a consumer may change it). |
An easier way to do this is trying to replace every (non-public?) The problems are that this will probably be much slower and that neither |
@mrackwitz is working on a parser for |
👍 I was just about to comment about |
This is now a compiler warning on Swift 2.0, so maybe it should be closed. |
Agreed. Plus, this would have been difficult to do without LLMV IR access. |
Any chance of supporting this for class / struct properties? I noticed the swift compiler doesn't catch this. Is it too complex to support? |
It would be possible to build an analyzer rule to do that. |
Check if a
var
ever changes. If not,let
should be used.key.setter_accessibility
might be useful.The text was updated successfully, but these errors were encountered: