Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@krodak
Copy link
Member

@krodak krodak commented Sep 11, 2025

This PR updates ExportSwift.lookupType to handle changes introduced in newer SwiftSyntax, that would result in failed compilation with errors like:

cannot convert value of type 'GenericArgumentSyntax.Argument' to expected argument type 'TypeSyntax'

This happened because in newer SwiftSyntax the .argument property 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.

Copy link

Copilot AI left a 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 lookupType method 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.

Copy link
Member

@kateinoigakukun kateinoigakukun left a 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?

Copy link
Member

@kateinoigakukun kateinoigakukun left a 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 🙇

krodak reacted with laugh emoji
@kateinoigakukun kateinoigakukun merged commit a069e3a into swiftwasm:main Sep 11, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@kateinoigakukun kateinoigakukun kateinoigakukun approved these changes

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /