|
23 | 23 | #include "swift/AST/DiagnosticsParse.h"
|
24 | 24 | #include "swift/AST/GenericEnvironment.h"
|
25 | 25 | #include "swift/AST/GenericSignatureBuilder.h"
|
| 26 | +#include "swift/AST/ModuleNameLookup.h" |
26 | 27 | #include "swift/AST/NameLookup.h"
|
27 | 28 | #include "swift/AST/NameLookupRequests.h"
|
28 | 29 | #include "swift/AST/ParameterList.h"
|
@@ -1612,15 +1613,13 @@ void AttributeChecker::checkApplicationMainAttribute(DeclAttribute *attr,
|
1612 | 1613 | auto KitModule = C.getLoadedModule(Id_Kit);
|
1613 | 1614 | ProtocolDecl *ApplicationDelegateProto = nullptr;
|
1614 | 1615 | if (KitModule) {
|
1615 |
| - auto lookupOptions = defaultUnqualifiedLookupOptions; |
1616 |
| - lookupOptions |= NameLookupFlags::KnownPrivate; |
1617 |
| - |
1618 |
| - auto lookup = TC.lookupUnqualifiedType(KitModule, Id_ApplicationDelegate, |
1619 |
| - SourceLoc(), |
1620 |
| - lookupOptions); |
1621 |
| - if (lookup.size() == 1) |
1622 |
| - ApplicationDelegateProto = dyn_cast<ProtocolDecl>( |
1623 |
| - lookup[0].getValueDecl()); |
| 1616 | + SmallVector<ValueDecl *, 1> decls; |
| 1617 | + namelookup::lookupInModule(KitModule, Id_ApplicationDelegate, |
| 1618 | + decls, NLKind::QualifiedLookup, |
| 1619 | + namelookup::ResolutionKind::TypesOnly, |
| 1620 | + KitModule); |
| 1621 | + if (decls.size() == 1) |
| 1622 | + ApplicationDelegateProto = dyn_cast<ProtocolDecl>(decls[0]); |
1624 | 1623 | }
|
1625 | 1624 |
|
1626 | 1625 | if (!ApplicationDelegateProto ||
|
|
0 commit comments