Skip to content

Commit e214083

Browse files
committed
Make our use of SwiftSyntax APIs more resilient to precompiled SwiftSyntax
1 parent 294ac2c commit e214083

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Package.resolved

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/ComposableArchitectureMacros/Availability.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ extension AttributeListSyntax.Element {
8686
if let availability = ifConfig.availability {
8787
return .ifConfigDecl(availability)
8888
}
89+
@unknown default:
90+
return nil
8991
}
9092
return nil
9193
}

Sources/ComposableArchitectureMacros/ObservableStateMacro.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,11 @@ extension VariableDeclSyntax {
215215
}
216216

217217
extension ObservableStateMacro: MemberMacro {
218-
public static func expansion<
219-
Declaration: DeclGroupSyntax,
220-
Context: MacroExpansionContext
221-
>(
218+
public static func expansion(
222219
of node: AttributeSyntax,
223-
providingMembersOf declaration: Declaration,
224-
in context: Context
220+
providingMembersOf declaration: some DeclGroupSyntax,
221+
conformingTo protocols: [TypeSyntax],
222+
in context: some MacroExpansionContext
225223
) throws -> [DeclSyntax] {
226224
guard !declaration.isEnum
227225
else {

Sources/ComposableArchitectureMacros/PresentsMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ extension TypeSyntax {
219219
genericArgumentClause: GenericArgumentClauseSyntax(
220220
arguments: [
221221
GenericArgumentSyntax(
222-
argument: self
222+
argument: GenericArgumentSyntax.Argument(self)
223223
)
224224
]
225225
)

0 commit comments

Comments
 (0)