Skip to content

Commit f40481f

Browse files
authored
Merge pull request #2865 from tshortli/silence-unknown-cases-warnings
Silence `switch covers known cases` warnings when building with resilience
2 parents 784cf79 + 48a4f5d commit f40481f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/SwiftCompilerPluginMessageHandling/Macros.swift

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ extension PluginProviderMessageHandler {
167167
switch macroDefinition.formatMode {
168168
case .auto: collapseIndentationWidth = nil
169169
case .disabled: collapseIndentationWidth = []
170+
#if RESILIENT_LIBRARIES
171+
@unknown default: fatalError()
172+
#endif
170173
}
171174
// Make a single element array by collapsing the results into a string.
172175
expandedSources = [

Sources/SwiftSyntaxMacroExpansion/MacroExpansion.swift

+3
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ public func expandAttachedMacro<Context: MacroExpansionContext>(
404404
switch definition.formatMode {
405405
case .auto: collapseIndentationWidth = indentationWidth
406406
case .disabled: collapseIndentationWidth = []
407+
#if RESILIENT_LIBRARIES
408+
@unknown default: fatalError()
409+
#endif
407410
}
408411
return collapse(
409412
expansions: expandedSources,

0 commit comments

Comments
 (0)