Promote AutoCloseable & use to stable #KT-65532

This commit is contained in:
Abduqodiri Qurbonzoda
2024-02-25 15:57:48 +02:00
committed by Space Team
parent 708ed81eb2
commit 98ad68eb90
4 changed files with 16 additions and 18 deletions
+4 -4
View File
@@ -12,8 +12,8 @@ import kotlin.contracts.contract
* A resource that can be closed or released.
*/
@Suppress("NO_ACTUAL_FOR_EXPECT")
@SinceKotlin("1.8")
@ExperimentalStdlibApi
@SinceKotlin("2.0")
@WasExperimental(ExperimentalStdlibApi::class)
public expect interface AutoCloseable {
/**
* Closes this resource.
@@ -43,8 +43,8 @@ public expect interface AutoCloseable {
* @return the result of [block] function invoked on this resource.
*/
@Suppress("NO_ACTUAL_FOR_EXPECT", "EXPECTED_DECLARATION_WITH_BODY")
@SinceKotlin("1.8")
@ExperimentalStdlibApi
@SinceKotlin("2.0")
@WasExperimental(ExperimentalStdlibApi::class)
@kotlin.internal.InlineOnly
public expect inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
contract {