-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: implement isFinal
using a request evaluator
#23932
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
@swift-ci Please test source compatibility |
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.
This looks wonderful. I only have a couple of minor questions and suggestions.
I reworked @slavapestov I'm looking into remaining issues with some getters that are incorrectly marked as 'final', or not marked when they should be. Let me know if you see something else that seems off with how the accessors are handled. |
@@ -367,10 +367,6 @@ createCoroutineAccessorPrototype(AbstractStorageDecl *storage, | |||
if (isStatic) | |||
accessor->setStatic(); | |||
|
|||
// The accessor is final if the storage is. | |||
if (storage->isFinal()) | |||
makeFinal(ctx, accessor); |
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.
makeFinal() should be dead code now, you can remove it from its .cpp and .h files
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.
Thanks for the changes. One final round of suggestions!
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
Add the request evaluator `IsFinalRequest` to lazily determine if a `ValueDecl` is final.
@swift-ci Please smoke test |
@swift-ci Please smoke test Linux |
1 similar comment
@swift-ci Please smoke test Linux |
isFinal
using a request evaluatorisFinal
using a request evaluator
…ed members of a final class I believe this was fixed with swiftlang#23932. 5.1 had an inconsistency here because the synthesized declaration was not marked as final; we would sometimes check if a method itself was final, other times we would check if both the method and the class were final. Lucky it worked out so that the emitted vtable entry did not appear to ever have been used. Make sure this behavior doesn't change going forward with a test.
Add the request evaluator
IsFinalRequest
to lazily determine if aValueDecl
is final.