-
-
Notifications
You must be signed in to change notification settings - Fork 57
BridgeJS: fix: switch to direct TypeSyntax initialiser #445
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
BridgeJS: fix: switch to direct TypeSyntax initialiser #445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes a compilation issue in BridgeJS by updating the handling of SwiftSyntax generic arguments to use direct TypeSyntax initializers instead of accessing the .argument property directly. This addresses breaking changes in newer SwiftSyntax versions where the argument property returns a wrapper type instead of TypeSyntax.
- Updates generic argument handling to use TypeSyntax initializer for compatibility
- Fixes two instances in the
lookupTypemethod for both identifier and member type handling
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a runtime test case to cover the case to keep it compiled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was confused. Given that it's an issue at the compile-time of BridgeJSCore, we don't need a runtime test case 🙇
a069e3a
into
swiftwasm:main
This PR updates
ExportSwift.lookupTypeto handle changes introduced in newer SwiftSyntax, that would result in failed compilation with errors like:This happened because in newer SwiftSyntax the
.argumentproperty of GenericArgumentSyntax no longer returns a TypeSyntax directly, but a new wrapper type (GenericArgumentSyntax.Argument).I've just noticed this while working with other wasm32 Swift SDK with threads support, update approach should work properly for all sdk versions.