Skip to content

Commit ea3a418

Browse files
author
Sergey Mashkov
committed
IO: fix writer scope type
1 parent 8e13241 commit ea3a418

File tree

1 file changed

+2
-2
lines changed
  • core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io

1 file changed

+2
-2
lines changed

core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io/WriterJob.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface WriterScope : CoroutineScope {
2222

2323
fun writer(coroutineContext: CoroutineContext,
2424
channel: ByteChannel,
25-
block: suspend CoroutineScope.() -> Unit): WriterJob {
25+
block: suspend WriterScope.() -> Unit): WriterJob {
2626
val coroutine = WriterCoroutine(newCoroutineContext(coroutineContext), channel)
2727
coroutine.initParentJob(coroutineContext[Job])
2828
block.startCoroutine(coroutine, coroutine)
@@ -31,7 +31,7 @@ fun writer(coroutineContext: CoroutineContext,
3131

3232
fun writer(coroutineContext: CoroutineContext,
3333
autoFlush: Boolean = false,
34-
block: suspend CoroutineScope.() -> Unit): WriterJob = writer(coroutineContext, ByteChannel(autoFlush), block)
34+
block: suspend WriterScope.() -> Unit): WriterJob = writer(coroutineContext, ByteChannel(autoFlush), block)
3535

3636
private class WriterCoroutine(ctx: CoroutineContext, channel: ByteChannel)
3737
: ByteChannelCoroutine(ctx, channel), WriterScope, WriterJob

0 commit comments

Comments
 (0)