-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Suppress set accessor availability diagnostics in LoadExpr
s
#74690
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: Suppress set accessor availability diagnostics in LoadExpr
s
#74690
Conversation
Many of the new FIXMEs demonstrate the regression reported in rdar://129679658.
This fixes a regression from swiftlang#72369. The compiler now incorrectly diagnoses use of an unavailable setter in this example: ``` func increaseBrightness(in window: UIWindow) { // warning: setter for 'screen' was deprecated in iOS 13.0 window.screen.brightness = 1.0 } ``` While the setter is deprecated, it would not be called in the generated code since `screen` is a reference type and there is no writeback through the setter for `screen` after setting `brightness`. Resolves rdar://129679658
93ec588
to
95cf7cf
Compare
Fixes missing setter availability diagnostics in some edge cases.
95cf7cf
to
31df22f
Compare
@swift-ci please smoke test |
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'm not an expert on this part of Sema, but the implementation seems plausible and the tests look good.
I have some new reports with additional test cases that aren't fixed by this but I'm going to build on top of it with another PR to fix those. |
@tshortli Sounds good! |
Further iteration here: #74793 |
This fixes a regression from #72369. The compiler now incorrectly diagnoses use of an unavailable setter in this example:
While the setter is deprecated, it would not be called in the generated code since
screen
is a reference type and there is no writeback through the setter forscreen
after settingbrightness
.Resolves rdar://129679658