Damn, Kotlin extensions aren’t compiled into Swift...
# kotlin-native
r
Damn, Kotlin extensions aren’t compiled into Swift extensions?
s
It is compiled for classes (except for
Any
).
r
Then why did this
Copy code
fun <T> Deferred<T>.subscribe(
    onSuccess: (T) -> Unit,
    onError: (Throwable) -> Unit
): DisposableHandle =
    invokeOnCompletion {
        if (it == null) {
            onSuccess(getCompleted())
        } else {
            onError(it)
        }
    }
in a file named
RxDeferred.kt
got compiled to
Copy code
open class RxDeferredKt : KotlinBase {

    open class func subscribe(_ receiver: Kotlinx_coroutines_core_nativeDeferred, onSuccess: @escaping (Any?) -> KotlinUnit, onError: @escaping (KotlinThrowable) -> KotlinUnit) -> Kotlinx_coroutines_core_nativeDisposableHandle
}
?
s
Because
Deferred
is
interface
.
r
Oh. Seems legit. Thanks