Skip to content

Commit 2d8cad0

Browse files
committed
Docs for context/coroutineContext in AbstractCoroutine are fixed
1 parent 35f082e commit 2d8cad0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

common/kotlinx-coroutines-core-common/src/AbstractCoroutine.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ public abstract class AbstractCoroutine<in T>(
3838
protected val parentContext: CoroutineContext,
3939
active: Boolean = true
4040
) : JobSupport(active), Job, Continuation<T>, CoroutineScope {
41+
/**
42+
* Context of this coroutine that includes this coroutine as a [Job].
43+
*/
4144
@Suppress("LeakingThis")
4245
public final override val context: CoroutineContext = parentContext + this
43-
@Deprecated("Replaced with context", replaceWith = ReplaceWith("context"))
46+
47+
/**
48+
* Context of this scope which is the same as the [context] of this coroutine.
49+
*/
4450
public override val coroutineContext: CoroutineContext get() = context
4551

4652
override val isActive: Boolean get() = super<JobSupport>.isActive

common/kotlinx-coroutines-core-common/src/CoroutineScope.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public interface CoroutineScope {
7171
get() = coroutineContext[Job]?.isActive ?: true
7272

7373
/**
74-
* Returns the context of this scope.
74+
* Context of this scope.
7575
*/
7676
public val coroutineContext: CoroutineContext
7777
}

0 commit comments

Comments
 (0)