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

while let _ incorrectly changed to while _ #1669

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

Comments

Projects
None yet
3 participants
@mpokryva

mpokryva commented Jul 12, 2017

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 from `while let _` incorrectly changed to `while _` to while let _ incorrectly changed to while _ Jul 12, 2017

@jpsim jpsim added the bug label Jul 12, 2017

@jpsim

This comment has been minimized.

Show comment
Hide comment
@jpsim

jpsim Jul 12, 2017

Collaborator

Thanks for reporting this.

Collaborator

jpsim commented Jul 12, 2017

Thanks for reporting this.

@jpsim

This comment has been minimized.

Show comment
Hide comment
@jpsim

jpsim Jul 12, 2017

Collaborator

Is this with SwiftLint 0.20.1?

Collaborator

jpsim commented Jul 12, 2017

Is this with SwiftLint 0.20.1?

@mpokryva

This comment has been minimized.

Show comment
Hide comment
@mpokryva

mpokryva Jul 12, 2017

Yes, it is.

mpokryva commented Jul 12, 2017

Yes, it is.

@mpokryva

This comment has been minimized.

Show comment
Hide comment
@mpokryva

mpokryva Jul 12, 2017

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

mpokryva commented Jul 12, 2017

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

@jpsim

This comment has been minimized.

Show comment
Hide comment
@jpsim

jpsim Jul 12, 2017

Collaborator

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

Collaborator

jpsim commented Jul 12, 2017

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

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Jul 12, 2017

Collaborator

That's not supported in ifs as well:

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

marcelofabri commented Jul 12, 2017

That's not supported in ifs as well:

error: use of '=' in a boolean context, did you mean '=='?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment