Skip to content
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

Make @Suspendable work on lambdas again in Kotlin M13 #122

Closed
wants to merge 1 commit into from
Closed

Make @Suspendable work on lambdas again in Kotlin M13 #122

wants to merge 1 commit into from

Conversation

aristotaloss
Copy link

Adds a new annotation (co.paralleluniverse.kotlin.fibers.Suspendable) in Kotlin using the new Kotlin runtime target and retention API to allow putting @Suspendable on lambdas as per before M13.

Example:

import co.paralleluniverse.kotlin.fibers.Suspendable

@Suspendable {
    Fiber.sleep(100)
    println("Hello")
}

The functionality described above broke when M13 required explicit annotation targeting to expressions in order to use them on Lambdas. To solve this, I have created a simple new annotation under the quasar-kotlin module which will also be recognized as instrument hinting to mark suspendable functions or lambdas.

This closes #121 if merged.

@aristotaloss
Copy link
Author

Note: I have signed the electronic agreement on contributing.

@circlespainter
Copy link
Member

Solved in a different way with later Kotlin releases, thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Making SuspendableCallable @Suspendable { .. } work again with Kotlin
2 participants