Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

while let _ incorrectly changed to while _ #1669

Closed
mpokryva opened this issue Jul 12, 2017 · 6 comments
Closed

while let _ incorrectly changed to while _ #1669

mpokryva opened this issue Jul 12, 2017 · 6 comments
Assignees
Labels
bug Unexpected and reproducible misbehavior.

Comments

@mpokryva
Copy link

Ran autocorrect and SwiftLint changed:

while let _ = SplashStyle(rawValue: maxValue) {
    maxValue += 1
}

to

while _ = SplashStyle(rawValue: maxValue) {
    maxValue += 1
}

Expected result: Keep it unchanged.

@mpokryva mpokryva changed the title while let _ incorrectly changed to while _ while let _ incorrectly changed to while _ Jul 12, 2017
@jpsim jpsim added the bug Unexpected and reproducible misbehavior. label Jul 12, 2017
@jpsim
Copy link
Collaborator

jpsim commented Jul 12, 2017

Thanks for reporting this.

@jpsim
Copy link
Collaborator

jpsim commented Jul 12, 2017

Is this with SwiftLint 0.20.1?

@mpokryva
Copy link
Author

Yes, it is.

@mpokryva
Copy link
Author

This is probably due to the removal of unnecessary variables in if let statements.
Example: if let foo (foo is not used) --> if _ .

@jpsim
Copy link
Collaborator

jpsim commented Jul 12, 2017

Sounds like a good Swift Evolution opportunity to align those two syntaxes.

@marcelofabri
Copy link
Collaborator

That's not supported in ifs as well:

error: use of '=' in a boolean context, did you mean '=='?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

3 participants