Skip to content

Commit 26cc907

Browse files
authored
Compare identifier declarations (#6589)
1 parent 17d5fee commit 26cc907

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Source/SwiftLintCore/Visitors/DeclaredIdentifiersTrackingVisitor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ open class DeclaredIdentifiersTrackingVisitor<Configuration: RuleConfiguration>:
7171
/// - identifier: An identifier.
7272
/// - Returns: `true` if the identifier was declared previously.
7373
public func hasSeenDeclaration(for identifier: String) -> Bool {
74-
scope.contains { $0.contains { $0.name == identifier } }
74+
scope.contains { $0.contains { $0.declares(id: identifier) } }
7575
}
7676

7777
override open func visit(_ node: CodeBlockItemListSyntax) -> SyntaxVisitorContinueKind {

0 commit comments

Comments
 (0)