Get rid of SuspendFunctionX interfaces

Use a pair of effectively abstract methods in CoroutineImpl instead
This commit is contained in:
Denis Zharkov
2017-01-14 13:54:04 +03:00
parent d346cbbe61
commit 85a3fefcc6
5 changed files with 16 additions and 44 deletions
@@ -17,7 +17,7 @@ import kotlin.coroutines.intrinsics.*
public fun <R, T> (suspend R.() -> T).createCoroutine(
receiver: R,
completion: Continuation<T>
): Continuation<Unit> = (this as kotlin.jvm.internal.SuspendFunction1<R, T>).create(receiver, completion)
): Continuation<Unit> = (this as kotlin.jvm.internal.CoroutineImpl).create(receiver, completion)
/**
* Starts coroutine with receiver type [R] and result type [T].
@@ -43,7 +43,7 @@ public fun <R, T> (suspend R.() -> T).startCoroutine(
@Suppress("UNCHECKED_CAST")
public fun <T> (suspend () -> T).createCoroutine(
completion: Continuation<T>
): Continuation<Unit> = (this as kotlin.jvm.internal.SuspendFunction0<T>).create(completion)
): Continuation<Unit> = (this as kotlin.jvm.internal.CoroutineImpl).create(completion)
/**
* Starts coroutine without receiver and with result type [T].