Add @unknown default to switch over RawSameTypeRequirementSyntax.LeftType#3331
Open
nesium wants to merge 1 commit into
Open
Add @unknown default to switch over RawSameTypeRequirementSyntax.LeftType#3331nesium wants to merge 1 commit into
nesium wants to merge 1 commit into
Conversation
…Type The switch over `firstArgument` in `parseGenericWhereClauseRequirements` (Sources/SwiftParser/Declarations.swift) only handles `.expr` and `.type`. `RawSameTypeRequirementSyntax.LeftType` is a public enum that isn't `@frozen`, so consumers building swift-syntax with `BUILD_LIBRARY_FOR_DISTRIBUTION=YES` hit a compile error here. Wrap the switch with the `#if RESILIENT_LIBRARIES @unknown default: fatalError() #endif` clause that was established for this exact situation in eee827f.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
The switch over
firstArgumentinparseGenericWhereClauseRequirements(aroundSources/SwiftParser/Declarations.swift:766) only handles.exprand.type.RawSameTypeRequirementSyntax.LeftTypeis a public enum that isn't@frozen, so consumers building swift-syntax withBUILD_LIBRARY_FOR_DISTRIBUTION=YEShit:The same situation was already addressed across the codebase in eee827f by wrapping such switches in
#if RESILIENT_LIBRARIES @unknown default: fatalError() #endif. This switch was added later and is missing the clause, so the PR just brings it in line.I ran into this while archiving an XCFramework that links a
.macrotarget depending on swift-syntax.