Skip to content

BridgeJS: Fix closures with struct return#739

Open
wfltaylor wants to merge 1 commit intoswiftwasm:mainfrom
wfltaylor:fix-closure-struct-return
Open

BridgeJS: Fix closures with struct return#739
wfltaylor wants to merge 1 commit intoswiftwasm:mainfrom
wfltaylor:fix-closure-struct-return

Conversation

@wfltaylor
Copy link
Copy Markdown
Contributor

Currently, the following code will result in generated code that fails to compile.

@JS public struct Animal {
    public let type: String
}

@JS func roundtripAnimal(_ animalClosure: (Animal) -> Animal) -> (Animal) -> Animal

The generated code uses bridgeJSLiftReturn with no arguments, which doesn’t exist.

This fixes this by adding an overload for bridgeJSLiftReturn which uses the stack ABI.

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.

1 participant