Skip to content

Commit

Permalink
Add back opt-in requirement for AutoCloseable
Browse files Browse the repository at this point in the history
  • Loading branch information
kyay10 committed May 18, 2024
1 parent 1ff7f5f commit a1303b6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public inline fun <A> autoCloseScope(block: AutoCloseScope.() -> A): A = with(De
public interface AutoCloseScope {
public fun onClose(release: (Throwable?) -> Unit)

@ExperimentalStdlibApi
public fun <A : AutoCloseable> install(autoCloseable: A): A =
autoCloseable.also { onClose { autoCloseable.close() } }
}
Expand Down

0 comments on commit a1303b6

Please sign in to comment.