Skip to content

[4.0] [Clang importer] Infer @_downgrade_exhaustivity_check for new-to-2017 enum elements in Swift 3 #10599

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

DougGregor
Copy link
Member

Explanation: In Swift 3 mode, downgrade the "switch is not exhaustive" error to a warning when the missing cases were introduced in the 2017 SDKs.
Scope: Fixes a source-compatibility problem with the newer SDKs for applications that are switching on enums provided by the system.
Radar: rdar://problem/32824207.
Risk: Low; we're inferring a new attribute in specific cases in the Clang importer, which only affects diagnostics.
Testing: Compiler regression tests.

… enum elements in Swift 3.

In Swift 3 mode, infer @_downgrade_exhaustivity_check for any enum
elements that were introduced in the 2017 SDKs (macOS 10.13, iOS 11.0,
tvOS 11.0, watchOS 4.0). This is a stop-gap until we get "open" enums,
but serves an important source-compatibility use case.

Fixes rdar://problem/32824207.

(cherry picked from commit f855d2f)
@DougGregor DougGregor added this to the Swift 4.0 milestone Jun 26, 2017
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit c75dbf9 into swiftlang:swift-4.0-branch Jun 27, 2017
@DougGregor DougGregor deleted the infer-downgrade-exhaustivity-check-4.0 branch June 27, 2017 15:09
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.

1 participant