File tree 2 files changed +5
-5
lines changed
Sources/XCTestParametrizedMacroMacros
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ struct MacroDeclarationHelper {
11
11
12
12
/// Returns 'TokenSyntax' representing name of the input parameter.
13
13
var inputParamName : TokenSyntax ? {
14
- declaration. signature. input . parameterList . first? . secondName
14
+ declaration. signature. parameterClause . parameters . first? . secondName
15
15
}
16
16
17
17
/// Returns 'TypeSyntax' representing type of the input object.
18
18
var inputParamType : TypeSyntax ? {
19
- declaration. signature. input . parameterList . first? . type
19
+ declaration. signature. parameterClause . parameters . first? . type
20
20
}
21
21
22
22
var firstAttribute : AttributeSyntax ? {
@@ -25,11 +25,11 @@ struct MacroDeclarationHelper {
25
25
26
26
var inputValues : ArrayElementListSyntax {
27
27
get throws {
28
- guard let firstMacroArgument = firstAttribute? . argument ? . as ( TupleExprElementListSyntax . self) else {
28
+ guard let firstMacroArgument = firstAttribute? . arguments ? . as ( LabeledExprListSyntax . self) else {
29
29
throw ParametrizeMacroError . macroAttributeNotAnArray
30
30
}
31
31
32
- guard let arrayOfValues = firstMacroArgument. first? . as ( TupleExprElementSyntax . self) ? . expression. as ( ArrayExprSyntax . self) ? . elements else {
32
+ guard let arrayOfValues = firstMacroArgument. first? . as ( LabeledExprSyntax . self) ? . expression. as ( ArrayExprSyntax . self) ? . elements else {
33
33
throw ParametrizeMacroError . macroAttributeNotAnArray
34
34
}
35
35
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public struct ParametrizeMacro: PeerMacro {
17
17
18
18
let macroDeclarationHelper = MacroDeclarationHelper ( declaration)
19
19
20
- let funcName = declaration. identifier
20
+ let funcName = declaration. name
21
21
guard let inputParamName = macroDeclarationHelper. inputParamName? . text else {
22
22
throw ParametrizeMacroError . functionInputParamSecondNameMissing
23
23
}
You can’t perform that action at this time.
0 commit comments