Skip to content

Commit ca2c9ea

Browse files
committed
Use TokenSyntax.keyword(.inout).text for inout parameter detection
Replace hardcoded "inout" string with TokenSyntax.keyword(.inout).text for more robust and version-independent inout parameter checking.
1 parent a6548a8 commit ca2c9ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SpyableMacro/Factories/ClosureFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,6 @@ extension FunctionParameterListSyntax.Element {
206206
// Check if the type contains 'inout' anywhere in its description
207207
// This works regardless of SwiftSyntax version and handles cases like "isolated inout"
208208
let typeDescription = self.type.description.trimmingCharacters(in: .whitespacesAndNewlines)
209-
return typeDescription.contains("inout")
209+
return typeDescription.contains(TokenSyntax.keyword(.inout).text)
210210
}
211211
}

0 commit comments

Comments
 (0)