-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Late code review feedback from @jrose-apple #27016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sema: Late code review feedback from @jrose-apple #27016
Conversation
@swift-ci Please smoke test |
lib/AST/ModuleNameLookup.cpp
Outdated
[](ValueDecl *VD) { return !isa<FuncDecl>(VD); }) | ||
== decls.end()) | ||
if (std::none_of(decls.begin() + initialCount, decls.end(), | ||
[](ValueDecl *VD) { return isa<FuncDecl>(VD); }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You inverted the logic here. "fail to find not-a-FuncDecl" is "none are not FuncDecls" or "all are FuncDecls".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, oops. I think all_of() is best here.
lib/Sema/TypeCheckAttr.cpp
Outdated
@@ -1617,7 +1617,7 @@ void AttributeChecker::checkApplicationMainAttribute(DeclAttribute *attr, | |||
namelookup::lookupInModule(KitModule, Id_ApplicationDelegate, | |||
decls, NLKind::QualifiedLookup, | |||
namelookup::ResolutionKind::TypesOnly, | |||
KitModule); | |||
nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you defaulted this argument, but if not can you give it an argument label comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we don't default it, and it can't be null. We assert if it is. I kept this behavior from the old implementation.
d9e09ba
to
82c0436
Compare
82c0436
to
08e5045
Compare
@swift-ci Please smoke test |
for (const auto &result : lookupString) { | ||
TC.validateDecl(result.getValueDecl()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need these so that IRGen can access them, no? Or is it requestified enough for that to not be a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the latter, but I think these are imported declarations so validateDecl() has no effect anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, right. My bad.
Addressing the post-commit review on #26865.