Skip to content

Commit d311533

Browse files
authored
Merge pull request #77059 from tshortli/fix-member-macro-warnings
Macros: Implement `expansion(of:providingMembersOf:conformingTo:in:)` on MemberMacros
2 parents 8732d9a + 5257747 commit d311533

File tree

5 files changed

+4
-2
lines changed

5 files changed

+4
-2
lines changed

lib/ASTGen/Sources/ASTGen/Exprs.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ extension ASTGenVisitor {
141141
return self.generate(nilLiteralExpr: node).asExpr
142142
case .optionalChainingExpr(let node):
143143
return self.generate(optionalChainingExpr: node).asExpr
144-
break
145144
case .packElementExpr(let node):
146145
return self.generate(packElementExpr: node).asExpr
147146
case .packExpansionExpr(let node):

lib/Macros/Sources/ObservationMacros/Availability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extension AttributeListSyntax.Element {
8686
if let availability = ifConfig.availability {
8787
return .ifConfigDecl(availability)
8888
}
89-
default:
89+
@unknown default:
9090
break
9191
}
9292
return nil

lib/Macros/Sources/ObservationMacros/ObservableMacro.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ extension ObservableMacro: MemberMacro {
196196
>(
197197
of node: AttributeSyntax,
198198
providingMembersOf declaration: Declaration,
199+
conformingTo protocols: [TypeSyntax],
199200
in context: Context
200201
) throws -> [DeclSyntax] {
201202
guard let identified = declaration.asProtocol(NamedDeclSyntax.self) else {

lib/Macros/Sources/SwiftMacros/DebugDescriptionMacro.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ extension DebugDescriptionMacro: MemberMacro {
2424
public static func expansion(
2525
of node: AttributeSyntax,
2626
providingMembersOf declaration: some DeclGroupSyntax,
27+
conformingTo protocols: [TypeSyntax],
2728
in context: some MacroExpansionContext
2829
)
2930
throws -> [DeclSyntax]

lib/Macros/Sources/SwiftMacros/OptionSetMacro.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ extension OptionSetMacro: MemberMacro {
152152
>(
153153
of attribute: AttributeSyntax,
154154
providingMembersOf decl: Decl,
155+
conformingTo protocols: [TypeSyntax],
155156
in context: Context
156157
) throws -> [DeclSyntax] {
157158
// Decode the expansion arguments.

0 commit comments

Comments
 (0)