Skip to content

Commit 067b489

Browse files
authored
Merge pull request #7 from pzmudzinski/fix-build-warnings-xcode-15
Remove deprecated API so xcode 15 won't throw build warnings
2 parents 1a48bb4 + 12b44a3 commit 067b489

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/XCTestParametrizedMacroMacros/MacroDeclarationHelper.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ struct MacroDeclarationHelper {
1111

1212
/// Returns 'TokenSyntax' representing name of the input parameter.
1313
var inputParamName: TokenSyntax? {
14-
declaration.signature.input.parameterList.first?.secondName
14+
declaration.signature.parameterClause.parameters.first?.secondName
1515
}
1616

1717
/// Returns 'TypeSyntax' representing type of the input object.
1818
var inputParamType: TypeSyntax? {
19-
declaration.signature.input.parameterList.first?.type
19+
declaration.signature.parameterClause.parameters.first?.type
2020
}
2121

2222
var firstAttribute: AttributeSyntax? {
@@ -25,11 +25,11 @@ struct MacroDeclarationHelper {
2525

2626
var inputValues: ArrayElementListSyntax {
2727
get throws {
28-
guard let firstMacroArgument = firstAttribute?.argument?.as(TupleExprElementListSyntax.self) else {
28+
guard let firstMacroArgument = firstAttribute?.arguments?.as(LabeledExprListSyntax.self) else {
2929
throw ParametrizeMacroError.macroAttributeNotAnArray
3030
}
3131

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 {
3333
throw ParametrizeMacroError.macroAttributeNotAnArray
3434
}
3535

Sources/XCTestParametrizedMacroMacros/XCTestParametrizedMacroMacro.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public struct ParametrizeMacro: PeerMacro {
1717

1818
let macroDeclarationHelper = MacroDeclarationHelper(declaration)
1919

20-
let funcName = declaration.identifier
20+
let funcName = declaration.name
2121
guard let inputParamName = macroDeclarationHelper.inputParamName?.text else {
2222
throw ParametrizeMacroError.functionInputParamSecondNameMissing
2323
}

0 commit comments

Comments
 (0)