Skip to content

Fixes for SwiftSyntax 601 #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 3, 2025
Merged

Fixes for SwiftSyntax 601 #42

merged 5 commits into from
Apr 3, 2025

Conversation

mbrandonw
Copy link
Member

SwiftSyntax 601 has some breaking changes from SwiftSyntax 600 that affected this library and so we need to do a little work to support all versions of SwiftSyntax.

@mbrandonw mbrandonw requested a review from stephencelis April 3, 2025 03:27
Comment on lines +76 to +94
let successReturnType: TypeSyntax? = {
guard isResultReturn
else { return returnType }

let successType = returnType!.as(IdentifierTypeSyntax.self)!.genericArgumentClause?.arguments.first!
.argument
#if canImport(SwiftSyntax601)
switch successType {
case .none:
return nil
case .type(let syntax):
return syntax
default:
return nil
}
#else
return successType
#endif
}()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't spend a ton of time coming up with the nicest way to support SwiftSyntax 601 for this because it's just a test.

@mbrandonw mbrandonw merged commit f2b3d26 into main Apr 3, 2025
3 checks passed
@mbrandonw mbrandonw deleted the fix-swift-syntax-601 branch April 3, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants