SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Condtional Binding Cascade triggered for let and var in the same statement

Open phelgo opened this issue 10 years ago • 4 comments

As of version 0.10.0, conditional binding statements that define both mutable and immutable variables like if let a = a, var b = b will trigger a warning

Repeated `let` statements in conditional binding cascade should be avoided.

I find this is a necessary pattern at times and I'm guessing it should be allowed by the linter.

phelgo avatar May 02 '16 10:05 phelgo

Duplicate of #642

norio-nomura avatar May 02 '16 10:05 norio-nomura

Sorry @norio-nomura for missing the previous issue (searched on the open ones) ! Thanks for the fix! 👍

phelgo avatar May 02 '16 10:05 phelgo

@norio-nomura I don't want to open an issue on this but what about using multiple 'let' value in a single guard statement? right now it showing a warning tnx

yuvigr avatar Aug 25 '16 08:08 yuvigr

We've removed that rule

jpsim avatar Aug 25 '16 14:08 jpsim