diff --git a/Sources/XCTestParametrizedMacroMacros/MacroDeclarationHelper.swift b/Sources/XCTestParametrizedMacroMacros/MacroDeclarationHelper.swift index ef7cf38..8bffadb 100644 --- a/Sources/XCTestParametrizedMacroMacros/MacroDeclarationHelper.swift +++ b/Sources/XCTestParametrizedMacroMacros/MacroDeclarationHelper.swift @@ -11,12 +11,12 @@ struct MacroDeclarationHelper { /// Returns 'TokenSyntax' representing name of the input parameter. var inputParamName: TokenSyntax? { - declaration.signature.input.parameterList.first?.secondName + declaration.signature.parameterClause.parameters.first?.secondName } /// Returns 'TypeSyntax' representing type of the input object. var inputParamType: TypeSyntax? { - declaration.signature.input.parameterList.first?.type + declaration.signature.parameterClause.parameters.first?.type } var firstAttribute: AttributeSyntax? { @@ -25,11 +25,11 @@ struct MacroDeclarationHelper { var inputValues: ArrayElementListSyntax { get throws { - guard let firstMacroArgument = firstAttribute?.argument?.as(TupleExprElementListSyntax.self) else { + guard let firstMacroArgument = firstAttribute?.arguments?.as(LabeledExprListSyntax.self) else { throw ParametrizeMacroError.macroAttributeNotAnArray } - guard let arrayOfValues = firstMacroArgument.first?.as(TupleExprElementSyntax.self)?.expression.as(ArrayExprSyntax.self)?.elements else { + guard let arrayOfValues = firstMacroArgument.first?.as(LabeledExprSyntax.self)?.expression.as(ArrayExprSyntax.self)?.elements else { throw ParametrizeMacroError.macroAttributeNotAnArray } diff --git a/Sources/XCTestParametrizedMacroMacros/XCTestParametrizedMacroMacro.swift b/Sources/XCTestParametrizedMacroMacros/XCTestParametrizedMacroMacro.swift index ee2eda2..ea51edc 100644 --- a/Sources/XCTestParametrizedMacroMacros/XCTestParametrizedMacroMacro.swift +++ b/Sources/XCTestParametrizedMacroMacros/XCTestParametrizedMacroMacro.swift @@ -17,7 +17,7 @@ public struct ParametrizeMacro: PeerMacro { let macroDeclarationHelper = MacroDeclarationHelper(declaration) - let funcName = declaration.identifier + let funcName = declaration.name guard let inputParamName = macroDeclarationHelper.inputParamName?.text else { throw ParametrizeMacroError.functionInputParamSecondNameMissing }