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

empty_enum_arguments not triggering for if case #3103

Closed
2 tasks done
lordzsolt opened this issue Feb 10, 2020 · 0 comments · Fixed by #3122
Closed
2 tasks done

empty_enum_arguments not triggering for if case #3103

lordzsolt opened this issue Feb 10, 2020 · 0 comments · Fixed by #3122
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@lordzsolt
Copy link
Contributor

lordzsolt commented Feb 10, 2020

New Issue Checklist

Describe the bug

This is not causing a violation, but it should:

enum Result<Success, Failure> {
    case success(Success)
    case failure(Failure)
}

let result: Result<Int, Error> = .success(3)
if case .success↓(_) = result {
    ...
}

If you write it out in a switch, it will trigger a violation:

switch result {
case .success↓(_):
    ...
case .failure↓(_):
    ...
}

Environment

  • SwiftLint version: 0.38.2

  • Installation method used: homebrew

  • Paste your configuration file:
    Default configuration

  • Are you using nested configurations: No

  • Which Xcode version are you using (check xcodebuild -version): 11.3.1

  • Do you have a sample that shows the issue: Check above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants