From 8e05ee478c413f250d43f658153293164731f604 Mon Sep 17 00:00:00 2001 From: ilya-g Date: Thu, 2 May 2019 11:21:11 +0300 Subject: [PATCH] Fix typos in coroutine docs as in the main kotlin repo (#2937) --- .../coroutines/experimental/Intrinsics.kt | 8 +++---- .../coroutines/intrinsics/IntrinsicsNative.kt | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt b/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt index 550a953a395..c270dc53f13 100644 --- a/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt +++ b/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt @@ -40,8 +40,8 @@ public actual fun (suspend R.() -> T).createCoroutineUnchecked( /** * Starts unintercepted coroutine without receiver and with result type [T] and executes it until its first suspension. * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the later case, the [completion] continuation is invoked when coroutine completes with result or exception. - * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of suspended + * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. + * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of a suspended * coroutine using a reference to the suspending function. */ @Suppress("UNCHECKED_CAST") @@ -53,8 +53,8 @@ public actual inline fun (suspend () -> T).startCoroutineUninterceptedOrRetu /** * Starts unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the later case, the [completion] continuation is invoked when coroutine completes with result or exception. - * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of suspended + * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. + * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of a suspended * coroutine using a reference to the suspending function. */ @Suppress("UNCHECKED_CAST") diff --git a/runtime/src/main/kotlin/kotlin/coroutines/intrinsics/IntrinsicsNative.kt b/runtime/src/main/kotlin/kotlin/coroutines/intrinsics/IntrinsicsNative.kt index 2834425a8c4..dfdbac2469f 100644 --- a/runtime/src/main/kotlin/kotlin/coroutines/intrinsics/IntrinsicsNative.kt +++ b/runtime/src/main/kotlin/kotlin/coroutines/intrinsics/IntrinsicsNative.kt @@ -10,15 +10,15 @@ import kotlin.coroutines.native.internal.* import kotlin.native.internal.* /** - * Starts unintercepted coroutine without receiver and with result type [T] and executes it until its first suspension. + * Starts an unintercepted coroutine without a receiver and with result type [T] and executes it until its first suspension. * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the later case, the [completion] continuation is invoked when coroutine completes with result or exception. + * In the latter case, the [completion] continuation is invoked when the coroutine completes with a result or an exception. * * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might - * be present in the completion's [CoroutineContext]. It is invoker's responsibility to ensure that the proper invocation + * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation * context is established. * - * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of suspended + * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of the suspended * coroutine using a reference to the suspending function. */ @Suppress("UNCHECKED_CAST") @@ -28,15 +28,15 @@ public actual inline fun (suspend () -> T).startCoroutineUninterceptedOrRetu ): Any? = (this as Function1, Any?>).invoke(completion) /** - * Starts unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. + * Starts an unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the later case, the [completion] continuation is invoked when coroutine completes with result or exception. + * In the latter case, the [completion] continuation is invoked when the coroutine completes with a result or an exception. * * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might - * be present in the completion's [CoroutineContext]. It is invoker's responsibility to ensure that the proper invocation + * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation * context is established. * - * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of suspended + * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of the suspended * coroutine using a reference to the suspending function. */ @Suppress("UNCHECKED_CAST") @@ -59,7 +59,7 @@ private object CoroutineSuspendedMarker * This function returns unintercepted continuation. * Invocation of `resume(Unit)` starts coroutine immediately in the invoker's call stack without going through the * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext]. - * It is invoker's responsibility to ensure that the proper invocation context is established. + * It is the invoker's responsibility to ensure that a proper invocation context is established. * Note that [completion] of this function may get invoked in an arbitrary context. * * [Continuation.intercepted] can be used to acquire the intercepted continuation. @@ -94,7 +94,7 @@ public actual fun (suspend () -> T).createCoroutineUnintercepted( * This function returns unintercepted continuation. * Invocation of `resume(Unit)` starts coroutine immediately in the invoker's call stack without going through the * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext]. - * It is invoker's responsibility to ensure that the proper invocation context is established. + * It is the invoker's responsibility to ensure that a proper invocation context is established. * Note that [completion] of this function may get invoked in an arbitrary context. * * [Continuation.intercepted] can be used to acquire the intercepted continuation. @@ -126,7 +126,7 @@ public actual fun (suspend R.() -> T).createCoroutineUnintercepted( * * This function shall be used on the immediate result of [createCoroutineUnintercepted] or [suspendCoroutineUninterceptedOrReturn], * in which case it checks for [ContinuationInterceptor] in the continuation's [context][Continuation.context], - * invokes [ContinuationInterceptor.interceptContinuation], caches and returns result. + * invokes [ContinuationInterceptor.interceptContinuation], caches and returns the result. * * If this function is invoked on other [Continuation] instances it returns `this` continuation unchanged. */