@@ -74,7 +74,7 @@ public operator fun CoroutineScope.plus(context: CoroutineContext): CoroutineSco
7474 ContextScope (coroutineContext + context)
7575
7676/* *
77- * Creates [CoroutineScope] for a UI components.
77+ * Creates the main [CoroutineScope] for UI components.
7878 *
7979 * Example of use:
8080 * ```
@@ -89,9 +89,9 @@ public operator fun CoroutineScope.plus(context: CoroutineContext): CoroutineSco
8989 *
9090 * ```
9191 *
92- * Resulting scope has [SupervisorJob] and [Dispatchers.Main].
93- * If you want to append additional elements to main scope, use [CoroutineScope.plus] operator:
94- * `val scope = MainScope() + CoroutineName("MyActivity") `.
92+ * The resulting scope has [SupervisorJob] and [Dispatchers.Main] context elements .
93+ * If you want to append additional elements to the main scope, use [CoroutineScope.plus] operator:
94+ * `val scope = MainScope() + CoroutineName("MyActivity")`.
9595 */
9696@Suppress(" FunctionName" )
9797public fun MainScope (): CoroutineScope = ContextScope (SupervisorJob () + Dispatchers .Main )
@@ -198,13 +198,13 @@ public fun CoroutineScope(context: CoroutineContext): CoroutineScope =
198198
199199/* *
200200 * Cancels this scope, including its job and all its children.
201- * Throws [IllegalStateException] if scope does not have a job in it.
201+ * Throws [IllegalStateException] if the scope does not have a job in it.
202202 *
203- * This API is experimental in order to investigate possible clashes with other cancellation mechanism .
203+ * This API is experimental in order to investigate possible clashes with other cancellation mechanisms .
204204 */
205205@Suppress(" NOTHING_TO_INLINE" )
206- @ExperimentalCoroutinesApi // Experimental and inline until 1.2
206+ @ExperimentalCoroutinesApi // Experimental and inline since 1.1.0, tentatively until 1.2.0
207207public inline fun CoroutineScope.cancel () {
208- val job = coroutineContext[Job ] ? : error(" Current scope cannot be cancelled because it does not have a job: $this " )
208+ val job = coroutineContext[Job ] ? : error(" Scope cannot be cancelled because it does not have a job: $this " )
209209 job.cancel()
210210}
0 commit comments