Skip to content

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

Merged

Conversation

slavapestov
Copy link
Contributor

Addressing the post-commit review on #26865.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

[](ValueDecl *VD) { return !isa<FuncDecl>(VD); })
== decls.end())
if (std::none_of(decls.begin() + initialCount, decls.end(),
[](ValueDecl *VD) { return isa<FuncDecl>(VD); })
Copy link
Contributor

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".

Copy link
Contributor Author

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.

@@ -1617,7 +1617,7 @@ void AttributeChecker::checkApplicationMainAttribute(DeclAttribute *attr,
namelookup::lookupInModule(KitModule, Id_ApplicationDelegate,
decls, NLKind::QualifiedLookup,
namelookup::ResolutionKind::TypesOnly,
KitModule);
nullptr);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@slavapestov slavapestov force-pushed the review-feedback-for-module-lookup branch from d9e09ba to 82c0436 Compare September 4, 2019 19:10
@slavapestov slavapestov force-pushed the review-feedback-for-module-lookup branch from 82c0436 to 08e5045 Compare September 4, 2019 19:11
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

for (const auto &result : lookupString) {
TC.validateDecl(result.getValueDecl());
}
}
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, right. My bad.

@slavapestov slavapestov merged commit e136834 into swiftlang:master Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants