Skip to content

Commit

Permalink
Make DefaultAutoCloseScope.close binary-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
kyay10 committed Nov 4, 2024
1 parent fd24bd9 commit 7373491
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ internal class DefaultAutoCloseScope : AutoCloseScope {
finalizers.update { it + release }
}

fun close(error: Throwable?) {
finalizers.value.asReversed().fold(error) { acc, finalizer ->
fun close(error: Throwable?): Nothing? {
return finalizers.value.asReversed().fold(error) { acc, finalizer ->
acc.add(runCatching { finalizer(error) }.exceptionOrNull())
}?.let { throw it }
}
Expand Down

0 comments on commit 7373491

Please sign in to comment.