Skip to content

Commit

Permalink
Merge pull request #125 from tishin/type-anyobject-fix
Browse files Browse the repository at this point in the history
Wrapped: Cast generic types to AnyObject explicitly
  • Loading branch information
migueldeicaza authored Sep 27, 2023
2 parents a64de72 + da988d8 commit b6f9118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftGodot/Core/Wrapped.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func register<T:Wrapped> (type name: StringName, parent: StringName, type: T.Typ
info.get_virtual_func = getVirtual
info.notification_func = notificationFunc

let retained = Unmanaged<AnyObject>.passRetained(type)
let retained = Unmanaged<AnyObject>.passRetained(type as AnyObject)
info.class_userdata = retained.toOpaque()

gi.classdb_register_extension_class (library, UnsafeRawPointer (&name.content), UnsafeRawPointer(&parent.content), &info)
Expand All @@ -194,7 +194,7 @@ public func register<T:Wrapped> (type: T.Type) {
return String (describing: t)
}

guard let superStr = getSuperType (type: type) else {
guard let superStr = getSuperType (type: type as AnyObject) else {
print ("You can not register the root class")
return
}
Expand Down

0 comments on commit b6f9118

Please sign in to comment.