Skip to content

Commit d9df0ea

Browse files
committed
AST: Update LookupVisibleDecls for primitive AnyObject
1 parent e5cc508 commit d9df0ea

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/AST/LookupVisibleDecls.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,6 @@ static void lookupVisibleProtocolMemberDecls(
471471
Type BaseTy, ProtocolType *PT, VisibleDeclConsumer &Consumer,
472472
const DeclContext *CurrDC, LookupState LS, DeclVisibilityKind Reason,
473473
LazyResolver *TypeResolver, VisitedSet &Visited) {
474-
if (PT->getDecl()->isSpecificProtocol(KnownProtocolKind::AnyObject)) {
475-
// Handle AnyObject in a special way.
476-
doDynamicLookup(Consumer, CurrDC, LS, TypeResolver);
477-
return;
478-
}
479474
if (!Visited.insert(PT->getDecl()).second)
480475
return;
481476

@@ -527,6 +522,12 @@ static void lookupVisibleMemberDeclsImpl(
527522
return;
528523
}
529524

525+
// If the base is AnyObject, we are doing dynamic lookup.
526+
if (BaseTy->isAnyObject()) {
527+
doDynamicLookup(Consumer, CurrDC, LS, TypeResolver);
528+
return;
529+
}
530+
530531
// If the base is a protocol, enumerate its members.
531532
if (ProtocolType *PT = BaseTy->getAs<ProtocolType>()) {
532533
lookupVisibleProtocolMemberDecls(BaseTy, PT, Consumer, CurrDC, LS, Reason,

0 commit comments

Comments
 (0)