swiftlang / swift-experimental-string-processing

An early experimental general-purpose pattern matching engine for Swift.
Apache License 2.0
278 stars 47 forks source link

[swift/main] Resolve `switch covers known cases, but 'Enum' may have additional unknown values` warnings #732

Closed tshortli closed 7 months ago

tshortli commented 7 months ago

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.

Note that this would not be required if _RegexParser could always build without library evolution, but that change had to be reverted (rdar://124541877).

tshortli commented 7 months ago

@swift-ci please test