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

strict_fileprivate doesn't support private protocols #4692

Closed
2 tasks done
cyril-lepottier opened this issue Jan 16, 2023 · 0 comments · Fixed by #4705
Closed
2 tasks done

strict_fileprivate doesn't support private protocols #4692

cyril-lepottier opened this issue Jan 16, 2023 · 0 comments · Fixed by #4705
Assignees
Labels
bug Unexpected and reproducible misbehavior.

Comments

@cyril-lepottier
Copy link

cyril-lepottier commented Jan 16, 2023

New Issue Checklist

Describe the bug

The rule strict_fileprivate triggers an error when using fileprivate on methods from a private protocol.

It was said in #1058, that

"when using Swift 4, since basically it'll make possible to convert all the "acceptable" usages of fileprivate to private".

However, this is not (no longer?) true since the swift compiler requires fileprivate when conforming to private protocol:

Method 'aMethod()' must be declared fileprivate because it matches a requirement in private protocol 'APrivateProtocol'

Environment

  • SwiftLint version: 0.50.3
  • Installation method used: Homebrew
  • Paste your configuration file:
only_rules:
  - strict_fileprivate
class AClass {
}

extension AClass: APrivateProtocol {

    fileprivate func aMethod() {
    }
}

private protocol APrivateProtocol {

    func aMethod()
}
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Jan 16, 2023
@SimplyDanny SimplyDanny self-assigned this Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants