Redundant Public Accessibility
Declarations that are marked public yet are not referenced from outside their home module are identified as having redundant public accessibility. In this scenario, the public annotation can be removed from the declaration.
Removing redundant public accessibility has a couple of benefits:
- It helps reduce the public surface area of your modules.
- In Whole Module Compilation mode, Swift can infer
finalby automatically discovering all potentially overriding declarations.finalclasses are better optimized by the compiler.
This analysis can be disabled with --disable-redundant-public-analysis.