Skip to content
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

Fix issue where initSwiftExtension types were expected to be homogenous #136

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

PadraigK
Copy link
Contributor

#initSwiftExtension(cdecl: "swift_entry_point", types: [
    Jumper.self,
    Circle.self,
    MainScene.self,
    HUD.self,
    BaseScreen.self,
    Screens.self,
    AboutScreen.self,
])

This code was failing with:

CircleJumpDriver.swift:19:5: error: cannot convert value of type 'BaseScreen.Type' to expected element type 'Array<AboutScreen.Type>.ArrayLiteralElement' (aka 'AboutScreen.Type')
BaseScreen.self,

This is because the generic on the initSwiftExtension definition was set up to expect an array of identically typed classes.

This PR changes the type to just be:[Wrapped.Type] which allows any types that conform to Wrapped, as opposed to a being an array of a single specific type that conforms.

@migueldeicaza migueldeicaza merged commit a5ae598 into migueldeicaza:main Sep 28, 2023
@migueldeicaza
Copy link
Owner

Thank you for the patch!

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