Skip to content

Conversation

krodak
Copy link
Contributor

@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.

@krodak krodak self-assigned this Sep 11, 2025
Copy link

@Copilot 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 🙇

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants