From c769b914d7e6c60ef1b322a802325696f5d59912 Mon Sep 17 00:00:00 2001 From: mb Date: Thu, 14 May 2026 16:03:12 +0100 Subject: [PATCH] Add @unknown default to switch over RawSameTypeRequirementSyntax.LeftType 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 eee827f7. --- Sources/SwiftParser/Declarations.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/SwiftParser/Declarations.swift b/Sources/SwiftParser/Declarations.swift index 9506a609a78..157f316fa90 100644 --- a/Sources/SwiftParser/Declarations.swift +++ b/Sources/SwiftParser/Declarations.swift @@ -916,6 +916,10 @@ extension Parser { ) ) } + #if RESILIENT_LIBRARIES + @unknown default: + fatalError() + #endif } keepGoing = self.consume(if: .comma)