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

Safeguard for leaked 'raise' or 'bind' #3329

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Conversation

serras
Copy link
Member

@serras serras commented Dec 20, 2023

This should be accompanied with a text in the Arrow docs.

It would be great to also detect Deferred or Flow from kotlinx.coroutines, but this doesn't seem like a good enough reason to add a dependency on those.

@serras serras requested review from franciscodr, nomisRev and a team December 20, 2023 15:44
Copy link
Contributor

Kover Report

File Coverage [98.11%]
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Fold.kt 98.11%
Total Project Coverage 54.66%

Copy link
Member

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

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

Oh, I really love this!! 😍 Thanks @serras, love this addition.

It would be great to also detect Deferred or Flow from kotlinx.coroutines, but this doesn't seem like a good enough reason to add a dependency on those.

Totally agree. Still wondering if this could be generalised, and if it could be useful to have in the language as an annotation similar to @RestrictSuspension but in relation to escaping of operations in DSLs. That probably opens another can of worms 😅

@serras serras merged commit 4001239 into main Dec 20, 2023
11 checks passed
@serras serras deleted the serras/prevent-leaked-raise branch December 20, 2023 21:36
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.

None yet

2 participants