Hey, anyone had an issue with `-Xobjc-generics` ? ...
# multiplatform
n
Hey, anyone had an issue with
-Xobjc-generics
? I’m getting
Any?
on iOS when I’m trying to consume some generics
Here’s my setup
k
What’s the Kotlin side?
n
what do you mean exactly?
v
This is desired behavior. Your generic in Kotlin needs to be
T : Any
since just
T
could be
String?
which can be null. I also got bitten by this
Copy code
// T : Any so that Swift understands that T can never be null.
sealed class SuccessFailure<T : Any>
n
Yes but my exact problem is, that I have an expected
Observable<T>
. And if I’m trying to
observe
an
Observable<String>
for example it cannot infer the type on iOS only
Any?
k
By “Kotlin side” I mean what dose your kotlin code look like. Not the gradle config
What type is
Observable
?
If it’s an interface, you can’t use generics on interfaces
That and the nullability thing are a result of Objective-C generics limitations
n
I see. Yes it's an interface
Thanks