Thread
#multiplatform
    nrobi

    nrobi

    2 years ago
    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
    kpgalligan

    kpgalligan

    2 years ago
    What’s the Kotlin side?
    nrobi

    nrobi

    2 years ago
    what do you mean exactly?
    v

    vanniktech

    2 years ago
    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
    // T : Any so that Swift understands that T can never be null.
    sealed class SuccessFailure<T : Any>
    nrobi

    nrobi

    2 years ago
    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?
    kpgalligan

    kpgalligan

    2 years ago
    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
    nrobi

    nrobi

    2 years ago
    I see. Yes it's an interface
    Thanks