Skip to content

Remove parent.start() from CancellableContinuationImpl.kt #2036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

qwwdfsad
Copy link
Collaborator

It seems to be the legacy from times when CC was a Job, in order to observe behaviour change, a specific example should be accurately made.

Note that this changes the behaviour of the following (weird, but still) test:

@Test
fun suspendCancellableContinuationParentStart() = runTest {
    val job = launch(start = CoroutineStart.LAZY) { println("Aha!") }
    ::suspendCancellable.startCoroutine(Continuation(job) {})
}

suspend fun suspendCancellable() = suspendCancellableCoroutine<Int> { 
    it.resumeWith(Result.success(42))
}

    It seems to be the legacy from times when CC was a Job, in order to observe behaviour change, a specific example should be accurately made
@qwwdfsad qwwdfsad requested a review from elizarov May 19, 2020 09:10
@qwwdfsad qwwdfsad marked this pull request as ready for review May 19, 2020 13:05
Copy link
Contributor

@elizarov elizarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 Great catch

@qwwdfsad qwwdfsad merged commit f02aadc into develop Sep 30, 2020
@qwwdfsad qwwdfsad deleted the redundant-start branch September 30, 2020 10:06
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this pull request Dec 28, 2020
It seems to be the legacy from times when CC was a Job, in order to observe behaviour change, a specific example should be accurately made
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this pull request Dec 28, 2020
It seems to be the legacy from times when CC was a Job, in order to observe behaviour change, a specific example should be accurately made
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants