You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class SomeClass {
}
fileprivate extension SomeClass {
fileprivate var someProperty: Int {
return 1
}
}
In this code, the fileprivate on the property is redundant with the one on the extension. Since access modifiers on extensions are an opt-in feature, anyone using it probably didn't intend to write the access in both places. We can warn about this.
Note that this does not apply to private, since private extension is currently equivalent to fileprivate extension, but private on the members means "within this file, visible inside this type and all of its extensions".
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: f95ec8d34147d6bb418a38ceed89d1e1
Issue Description:
In this code, the
fileprivate
on the property is redundant with the one on the extension. Since access modifiers on extensions are an opt-in feature, anyone using it probably didn't intend to write the access in both places. We can warn about this.Note that this does not apply to
private
, sinceprivate extension
is currently equivalent tofileprivate extension
, butprivate
on the members means "within this file, visible inside this type and all of its extensions".The text was updated successfully, but these errors were encountered: