Skip to content
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

force_unwrapping rule catches IBOutlet Collections in swiftlint 0.9.1 #546

Closed
tapi opened this issue Feb 17, 2016 · 4 comments
Closed

force_unwrapping rule catches IBOutlet Collections in swiftlint 0.9.1 #546

tapi opened this issue Feb 17, 2016 · 4 comments
Labels

Comments

@tapi
Copy link

tapi commented Feb 17, 2016

IBOutlets are always force unwrapped and generally the force_unwrap rule ignores them.

However it appears as though with swiftlint 0.9.1 it is catching IBOutlet collections. ie.

@IBOutlet weak var constraint: NSLayoutConstraint!

is ignored by the linter but

@IBOutlet var constraints: [NSLayoutConstraint]!

is not ignored

@tapi tapi changed the title force_unwrapping rule catches IBOutlet Collections force_unwrapping rule catches IBOutlet Collections Feb 17, 2016
@tapi tapi changed the title force_unwrapping rule catches IBOutlet Collections force_unwrapping rule catches IBOutlet Collections in swiftlint 0.9.1 Feb 17, 2016
@brandenr
Copy link

I would think the IBOutelts should be caught by the force unwrap rule. They actually can be nil at times and cause a crash

@ikesyo
Copy link
Contributor

ikesyo commented Feb 17, 2016

They are not forced unwrapping, but are defining properties of implicitly unwrapped optional. Those two are not the same. So force_unwrapping rule is catching IUO would be the real issue.

@norio-nomura
Copy link
Collaborator

Thanks for filing an issue.
This behavior has been changed by #537.
Maybe we need another approach for force_unwrapping.🤔

@norio-nomura
Copy link
Collaborator

I opened PR #552 for fixing the issue #546, #547.
Feedback is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants