https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
f

Federico Torres

02/10/2023, 3:36 PM
👋 any known workaround to this K/N problem? Let’s say I have a function like this
fun foo(map: Map<String, SomeDataClass?>)
When I try to use it from Swift,
SomeDataClass?
has the type
Any
:
func foo(map: [String: Any])
which forces me to downcast
m

mkrussel

02/10/2023, 3:37 PM
Objective-C doesn't support nullable types in their generics and when you use them they become Any. Need to use some wrapper around the
SomeDataClass
to hide the nulls.
f

Federico Torres

02/10/2023, 5:25 PM
Oh I see, thanks!
9 Views