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

Bug in empty_count rule #1241

Closed
phoney opened this issue Jan 24, 2017 · 1 comment
Closed

Bug in empty_count rule #1241

phoney opened this issue Jan 24, 2017 · 1 comment
Labels
duplicate Issues that already exist in other terms.

Comments

@phoney
Copy link

phoney commented Jan 24, 2017

The empty_count rule seems to key off a variable named 'count' that isn't related to the Container.count method. In the following code there is no reference to a Container but it still generates an Empty Count violation where it shouldn't.

func emptyCountBug(item: Int?) {
    if let count = item, count > 0 {
        print("Prefer checking isEmpty...")
    }
    if let count1 = item, count1 > 0 {
        print("No Comment")
    }
}
@marcelofabri
Copy link
Collaborator

Duplicate of #827.

@marcelofabri marcelofabri added the duplicate Issues that already exist in other terms. label Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues that already exist in other terms.
Projects
None yet
Development

No branches or pull requests

2 participants