diff --git a/Source/SwiftLintFramework/Rules/LowerACLThanBodyRule.swift b/Source/SwiftLintFramework/Rules/LowerACLThanBodyRule.swift index 47ac0d7e8..beeb5dfb8 100644 --- a/Source/SwiftLintFramework/Rules/LowerACLThanBodyRule.swift +++ b/Source/SwiftLintFramework/Rules/LowerACLThanBodyRule.swift @@ -62,7 +62,7 @@ public struct LowerACLThanParentRule: OptInRule, ConfigurationProviderRule { violationOffset = element.offset } - return [violationOffset].flatMap { $0 } + self.validateACL(isHigherThan: accessibility, in: element) + return [violationOffset].compactMap { $0 } + self.validateACL(isHigherThan: accessibility, in: element) } } }