Skip to content

AST: consider syntactic final in isPotentiallyOverridable(). NFC #41626

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

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Mar 2, 2022

This PR is an experiment to test whether isPotentiallyOverridable() can also take final into account.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Mar 2, 2022

@swift-ci please smoke test

Also, rename isPotentiallyOverridable() to isSyntacticallyOverridable().
@nkcsgexi nkcsgexi force-pushed the experiment-final-in-isPotentiallyOverridable branch from 80c666c to 1bc7039 Compare March 2, 2022 23:50
@nkcsgexi nkcsgexi changed the title [DNM] AST: consider syntactic final in isPotentiallyOverridable(). NFC AST: consider syntactic final in isPotentiallyOverridable(). NFC Mar 2, 2022
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Mar 2, 2022

@swift-ci please smoke test

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Mar 3, 2022

swiftlang/llvm-project#4013
@swift-ci please smoke test

if (isa<VarDecl>(this) ||
isa<SubscriptDecl>(this) ||
isa<FuncDecl>(this) ||
isa<DestructorDecl>(this)) {
if (static_cast<const ValueDecl*>(this)->isFinal()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could just make isFinal() const :)

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