Add type to package inputs to UnqualifiedLookupRequest

This allows us use an OptionSet parameter for
the request (as currently we can't directly use it
as a parameter due to not having an == definition
for it). It also allows us to regain default
arguments for the source loc and flag parameters.
This commit is contained in:
Hamish Knight
2019-11-15 16:09:38 -08:00
parent acbf0b264c
commit 2853615880
15 changed files with 111 additions and 61 deletions

View File

@@ -115,9 +115,10 @@ bool ASTScript::execute() const {
return true;
}
auto req = UnqualifiedLookupRequest{ctx.getIdentifier("View"), swiftUI,
SourceLoc(), UnqualifiedLookupFlags()};
auto viewLookup = evaluateOrDefault(ctx.evaluator, req, {});
auto descriptor = UnqualifiedLookupDescriptor(ctx.getIdentifier("View"),
swiftUI);
auto viewLookup = evaluateOrDefault(ctx.evaluator,
UnqualifiedLookupRequest{descriptor}, {});
auto viewProtocol =
dyn_cast_or_null<ProtocolDecl>(viewLookup.getSingleTypeResult());
if (!viewProtocol) {