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

Wrapped: Cast generic types to AnyObject explicitly #125

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

tishin
Copy link
Contributor

@tishin tishin commented Sep 25, 2023

Trying to build SwiftGodot on Windows results in the following errors:

C:\Projects\SwiftGodot\Sources\SwiftGodot\Core\Wrapped.swift:197:46: error: argument type 'T.Type' expected to be an instance of a class or class-constrained type
    guard let superStr = getSuperType (type: type) else {
                                             ^
C:\Projects\SwiftGodot\Sources\SwiftGodot\Core\Wrapped.swift:170:54: error: argument type 'T.Type' expected to be an instance of a class or class-constrained type
    let retained = Unmanaged<AnyObject>.passRetained(type)
                                                     ^

Explicit cast to AnyObject seems to fix the issue.

@tishin
Copy link
Contributor Author

tishin commented Sep 26, 2023

Building on Ubuntu also has this issue. I'm using Swift 5.9 toolchain in both cases.

@migueldeicaza migueldeicaza merged commit b6f9118 into migueldeicaza:main Sep 27, 2023
1 check passed
@migueldeicaza
Copy link
Owner

Thank you for your patch, and apologies for the delay, I missed it!

@tishin tishin deleted the type-anyobject-fix branch September 30, 2023 15:50
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