Skip to content

Commit c68cbe8

Browse files
committed
Sema: Remove hasAccess() checks
1 parent b4962e1 commit c68cbe8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/Sema/CalleeCandidateInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void CalleeCandidateInfo::filterList(ClosenessPredicate predicate) {
190190

191191
// Likewise, if the candidate is inaccessible from the scope it is being
192192
// accessed from, mark it as inaccessible or a general mismatch.
193-
if (VD->hasAccess() && !VD->isAccessibleFrom(CS.DC)) {
193+
if (!VD->isAccessibleFrom(CS.DC)) {
194194
// If this was an exact match, downgrade it to inaccessible, so that
195195
// accessible decls that are also an exact match will take precedence.
196196
// Otherwise consider it to be a general mismatch so we only list it in

lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,7 @@ static void checkRedeclaration(TypeChecker &tc, ValueDecl *current) {
720720
return;
721721

722722
ReferencedNameTracker *tracker = currentFile->getReferencedNameTracker();
723-
bool isCascading = true;
724-
if (current->hasAccess())
725-
isCascading = (current->getFormalAccess() > AccessLevel::FilePrivate);
723+
bool isCascading = (current->getFormalAccess() > AccessLevel::FilePrivate);
726724

727725
// Find other potential definitions.
728726
SmallVector<ValueDecl *, 4> otherDefinitions;

0 commit comments

Comments
 (0)