Emulate `protected` visiblity modifier on fields/functions
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
Swift has no protected modifier. It still is handly. Currently we just make it public and just agree to not use certain functions/fields.
This is obviously error prone. Best solution would be some sort of annotation, like this
class Foo {
@Protected
protected bar() {
//
}
}
and then linter would enforce not calling this outside of the class
Would that be possible?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name any files, tests, or entry points. Start by locating SwiftLint's rule and annotation-handling architecture, then determine whether a protected-visibility annotation and enforcement rule are feasible; done would require an agreed design and tests covering valid and invalid access.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100