Add 'suspendWithCurrentContinuation' and 'Suspend' object in built-ins

They are part of the new suspension convention, relevant
support in backends will be added in later commits

 #KT-14924 In Progress
This commit is contained in:
Denis Zharkov
2016-11-24 16:25:32 +03:00
parent a34c9c2580
commit 2c3b0aeddb
8 changed files with 113 additions and 1 deletions
@@ -0,0 +1,16 @@
package-fragment kotlin.coroutines
@kotlin.SinceKotlin(version = "1.1") public inline suspend fun </*0*/ T> suspendWithCurrentContinuation(/*0*/ body: (kotlin.coroutines.Continuation<T>) -> kotlin.Any?): T
@kotlin.SinceKotlin(version = "1.1") @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class AllowSuspendExtensions : kotlin.Annotation {
/*primary*/ public constructor AllowSuspendExtensions()
}
@kotlin.SinceKotlin(version = "1.1") public interface Continuation</*0*/ in P> {
public abstract fun resume(/*0*/ data: P): kotlin.Unit
public abstract fun resumeWithException(/*0*/ exception: kotlin.Throwable): kotlin.Unit
}
@kotlin.SinceKotlin(version = "1.1") public object Suspend {
/*primary*/ private constructor Suspend()
}