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

Fixes recover inconsistency with raise DSL on types other than Either #3052

Merged
merged 11 commits into from
Jun 1, 2023
Prev Previous commit
Next Next commit
Update arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/ra…
…ise/Builders.kt

Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
  • Loading branch information
yoxjames and nomisRev authored Jun 1, 2023
commit d4a771c288c8af9a6b3055ea5f2806cfc3ca054f
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public class OptionRaise(private val raise: Raise<None>) : Raise<None> by raise
@RaiseDSL
public inline fun <A> recover(
@BuilderInference block: OptionRaise.() -> A,
@BuilderInference recover: () -> A,
recover: () -> A,
): A = when (val option = option(block)) {
is None -> recover()
is Some<A> -> option.value
Expand Down