@@ -22,7 +22,7 @@ public struct ColorLiteralMacro: ExpressionMacro {
22
22
in context: some MacroExpansionContext
23
23
) -> ExprSyntax {
24
24
let argList = replaceFirstLabel (
25
- of: macro. argumentList , with: " _colorLiteralRed "
25
+ of: macro. arguments , with: " _colorLiteralRed "
26
26
)
27
27
let initSyntax : ExprSyntax = " .init( \( argList) ) "
28
28
return initSyntax
@@ -51,7 +51,7 @@ public struct AssertMacro: ExpressionMacro {
51
51
of macro: some FreestandingMacroExpansionSyntax ,
52
52
in context: some MacroExpansionContext
53
53
) -> ExprSyntax {
54
- guard let argument = macro. argumentList . first? . expression else {
54
+ guard let argument = macro. arguments . first? . expression else {
55
55
fatalError ( " boom " )
56
56
}
57
57
@@ -64,7 +64,7 @@ public struct StringifyMacro: ExpressionMacro {
64
64
of macro: some FreestandingMacroExpansionSyntax ,
65
65
in context: some MacroExpansionContext
66
66
) -> ExprSyntax {
67
- guard let argument = macro. argumentList . first? . expression else {
67
+ guard let argument = macro. arguments . first? . expression else {
68
68
fatalError ( " boom " )
69
69
}
70
70
@@ -77,7 +77,7 @@ public struct ExprAndDeclMacro: ExpressionMacro, DeclarationMacro {
77
77
of macro: some FreestandingMacroExpansionSyntax ,
78
78
in context: some MacroExpansionContext
79
79
) -> ExprSyntax {
80
- guard let argument = macro. argumentList . first? . expression else {
80
+ guard let argument = macro. arguments . first? . expression else {
81
81
fatalError ( " boom " )
82
82
}
83
83
@@ -97,7 +97,7 @@ public struct StringifyAndTryMacro: ExpressionMacro {
97
97
of macro: some FreestandingMacroExpansionSyntax ,
98
98
in context: some MacroExpansionContext
99
99
) -> ExprSyntax {
100
- guard let argument = macro. argumentList . first? . expression else {
100
+ guard let argument = macro. arguments . first? . expression else {
101
101
fatalError ( " boom " )
102
102
}
103
103
@@ -180,7 +180,7 @@ public enum AddBlocker: ExpressionMacro {
180
180
context. diagnose ( diag)
181
181
}
182
182
183
- return result. asProtocol ( FreestandingMacroExpansionSyntax . self) !. argumentList . first!. expression
183
+ return result. asProtocol ( FreestandingMacroExpansionSyntax . self) !. arguments . first!. expression
184
184
}
185
185
}
186
186
@@ -189,7 +189,7 @@ public class RecursiveMacro: ExpressionMacro {
189
189
of macro: some FreestandingMacroExpansionSyntax ,
190
190
in context: some MacroExpansionContext
191
191
) -> ExprSyntax {
192
- guard let argument = macro. argumentList . first? . expression,
192
+ guard let argument = macro. arguments . first? . expression,
193
193
argument. description == " false " else {
194
194
return " \( macro) "
195
195
}
@@ -237,7 +237,7 @@ public struct DefineBitwidthNumberedStructsMacro: DeclarationMacro {
237
237
of node: some FreestandingMacroExpansionSyntax ,
238
238
in context: some MacroExpansionContext
239
239
) throws -> [ DeclSyntax ] {
240
- guard let firstElement = node. argumentList . first,
240
+ guard let firstElement = node. arguments . first,
241
241
let stringLiteral = firstElement. expression. as ( StringLiteralExprSyntax . self) ,
242
242
stringLiteral. segments. count == 1 ,
243
243
case let . stringSegment( prefix) = stringLiteral. segments. first else {
@@ -333,7 +333,7 @@ public struct WarningMacro: ExpressionMacro {
333
333
of macro: some FreestandingMacroExpansionSyntax ,
334
334
in context: some MacroExpansionContext
335
335
) throws -> ExprSyntax {
336
- guard let firstElement = macro. argumentList . first,
336
+ guard let firstElement = macro. arguments . first,
337
337
let stringLiteral = firstElement. expression
338
338
. as ( StringLiteralExprSyntax . self) ,
339
339
stringLiteral. segments. count == 1 ,
@@ -362,13 +362,13 @@ public struct ErrorMacro: ExpressionMacro {
362
362
of macro: some FreestandingMacroExpansionSyntax ,
363
363
in context: some MacroExpansionContext
364
364
) throws -> ExprSyntax {
365
- guard let firstElement = macro. argumentList . first,
365
+ guard let firstElement = macro. arguments . first,
366
366
let stringLiteral = firstElement. expression. as ( StringLiteralExprSyntax . self) ,
367
367
stringLiteral. segments. count == 1 ,
368
368
case let . stringSegment( messageString) ? = stringLiteral. segments. first
369
369
else {
370
370
let errorNode : Syntax
371
- if let firstElement = macro. argumentList . first {
371
+ if let firstElement = macro. arguments . first {
372
372
errorNode = Syntax ( firstElement)
373
373
} else {
374
374
errorNode = Syntax ( macro)
@@ -470,6 +470,8 @@ extension AccessorBlockSyntax {
470
470
return false
471
471
case . getter:
472
472
return true
473
+ @unknown default :
474
+ return false
473
475
}
474
476
}
475
477
}
@@ -512,12 +514,6 @@ public struct WillSetMacro: AccessorMacro {
512
514
providingAccessorsOf declaration: some DeclSyntaxProtocol ,
513
515
in context: some MacroExpansionContext
514
516
) throws -> [ AccessorDeclSyntax ] {
515
- guard let varDecl = declaration. as ( VariableDeclSyntax . self) ,
516
- let binding = varDecl. bindings. first,
517
- let identifier = binding. pattern. as ( IdentifierPatternSyntax . self) ? . identifier else {
518
- return [ ]
519
- }
520
-
521
517
return [
522
518
"""
523
519
willSet { }
@@ -854,7 +850,7 @@ public enum LeftHandOperandFinderMacro: ExpressionMacro {
854
850
let visitor = Visitor ( context: context)
855
851
visitor. walk ( node)
856
852
857
- return node. argumentList . first!. expression
853
+ return node. arguments . first!. expression
858
854
}
859
855
}
860
856
@@ -995,7 +991,7 @@ public struct CoerceToIntMacro: ExpressionMacro {
995
991
of node: some FreestandingMacroExpansionSyntax ,
996
992
in context: some MacroExpansionContext
997
993
) -> ExprSyntax {
998
- " \( node. argumentList . first!. expression) as Int "
994
+ " \( node. arguments . first!. expression) as Int "
999
995
}
1000
996
}
1001
997
@@ -1660,7 +1656,7 @@ public struct DefineAnonymousTypesMacro: DeclarationMacro {
1660
1656
}
1661
1657
1662
1658
let accessSpecifier : String
1663
- if let _ = node. argumentList . first ( labeled: " public " ) {
1659
+ if let _ = node. arguments . first ( labeled: " public " ) {
1664
1660
accessSpecifier = " public "
1665
1661
} else {
1666
1662
accessSpecifier = " "
@@ -1695,7 +1691,7 @@ public struct DefineAnonymousTypesMacro: DeclarationMacro {
1695
1691
"""
1696
1692
]
1697
1693
1698
- if let _ = node. argumentList . first ( labeled: " causeErrors " ) {
1694
+ if let _ = node. arguments . first ( labeled: " causeErrors " ) {
1699
1695
1700
1696
results += [ """
1701
1697
@@ -1836,7 +1832,7 @@ public struct UseIdentifierMacro: DeclarationMacro {
1836
1832
of node: some FreestandingMacroExpansionSyntax ,
1837
1833
in context: some MacroExpansionContext
1838
1834
) throws -> [ DeclSyntax ] {
1839
- guard let argument = node. argumentList . first? . expression. as ( StringLiteralExprSyntax . self) else {
1835
+ guard let argument = node. arguments . first? . expression. as ( StringLiteralExprSyntax . self) else {
1840
1836
fatalError ( " boom " )
1841
1837
}
1842
1838
return [
0 commit comments