-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Eliminate some piecemeal unavailability diagnostics #77236
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: Eliminate some piecemeal unavailability diagnostics #77236
Conversation
Call `checkDeclarationAvailability()`, instead of just diagnosing unavailability.
@swift-ci please smoke test |
Call `checkDeclarationAvailability()`, instead of just diagnosing unavailability.
99eeea1
to
7e6e8ed
Compare
@swift-ci please smoke test |
Could this have caused the failures on https://ci.swift.org/job/swift-main-source-compat-suite/938/ and https://ci.swift.org/job/swift-main-source-compat-suite-debug/938/
rdar://138771328 |
Yes, it probably has. I'm taking a look, thanks for the heads up! |
swiftlang#77236 caused a source compatibility regression because `extractEnumElement()` does not suppress its diagnostics in the context of pattern matching. Potentially unavailable enum elements should not be diagnosed when pattern matching since the generated code will not retrieve the potentially unavailable element value on versions where it is unavailable. Fixes rdar://138771328.
Partially revert swiftlang#77236 in order to work around some issues related to the way `@_spi` attributes are printed and checked in swiftinterfaces. Resolves rdar://143029729.
…icit-unavailability-6.1 [6.1] Sema: Partially revert #77236
There were a few parts of the compiler that were specifically diagnosing just the unavailability of declarations in certain synthesized code:
ClangImporter
synthesized enum element accessors with Swift 2-era names.wrappedValue
accessors in synthesized property accessors for wrapped vars.These piecemeal diagnostics can be subsumed by performing full availability checks on the decl refs instead to catch more issues while also reducing the amount of availability spaghetti there is to maintain and refactor.