Skip to content

Resolve switch covers known cases, but 'Enum' may have additional unknown values warnings #2540

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

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

tshortli
Copy link
Contributor

When building with CMake during the Swift compiler build, the libraries in this package are built with library evolution enabled. That causes the compiler to emit diagnostics that encourage use of @unknown default to handle unknown cases that might be added in the future. Silence these warnings by adding @unknown default cases where they are missing. Guard these with the RESILIENT_LIBRARIES compilation condition to avoid triggering a Default will never be executed diagnostic during the package build.

@tshortli
Copy link
Contributor Author

@swift-ci please test

…known values` warnings.

When building with CMake during the Swift compiler build, the libraries in this
package are built with library evolution enabled. That causes the compiler to
emit diagnostics that encourage use of `@unknown default` to handle unknown
cases that might be added in the future. Silence these warnings by adding
`@unknown default` cases where they are missing. Guard these with the
`RESILIENT_LIBRARIES` compilation condition to avoid triggering a `Default will
never be executed` diagnostic during the package build.
@tshortli
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks!

@tshortli
Copy link
Contributor Author

@swift-ci please test macOS

@tshortli
Copy link
Contributor Author

@swift-ci please test Windows

@tshortli tshortli merged commit e63ea8a into swiftlang:main Mar 14, 2024
@tshortli tshortli deleted the unknown-default branch March 14, 2024 22:13
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