Promote AutoCloseable & use to stable #KT-65532
This commit is contained in:
committed by
Space Team
parent
708ed81eb2
commit
98ad68eb90
@@ -821,8 +821,8 @@ public inline fun kotlin.Long.toUShort(): kotlin.UShort
|
|||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun kotlin.Short.toUShort(): kotlin.UShort
|
public inline fun kotlin.Short.toUShort(): kotlin.UShort
|
||||||
|
|
||||||
@kotlin.SinceKotlin(version = "1.8")
|
@kotlin.SinceKotlin(version = "2.0")
|
||||||
@kotlin.ExperimentalStdlibApi
|
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun <T : kotlin.AutoCloseable?, R> T.use(block: (T) -> R): R
|
public inline fun <T : kotlin.AutoCloseable?, R> T.use(block: (T) -> R): R
|
||||||
|
|
||||||
@@ -869,8 +869,8 @@ public open class AssertionError : kotlin.Error {
|
|||||||
public constructor AssertionError(message: kotlin.String?, cause: kotlin.Throwable?)
|
public constructor AssertionError(message: kotlin.String?, cause: kotlin.Throwable?)
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.SinceKotlin(version = "1.8")
|
@kotlin.SinceKotlin(version = "2.0")
|
||||||
@kotlin.ExperimentalStdlibApi
|
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})
|
||||||
public interface AutoCloseable {
|
public interface AutoCloseable {
|
||||||
public abstract fun close(): kotlin.Unit
|
public abstract fun close(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ package kotlin
|
|||||||
import kotlin.contracts.InvocationKind
|
import kotlin.contracts.InvocationKind
|
||||||
import kotlin.contracts.contract
|
import kotlin.contracts.contract
|
||||||
|
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("2.0")
|
||||||
@ExperimentalStdlibApi
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
public actual interface AutoCloseable {
|
public actual interface AutoCloseable {
|
||||||
public actual fun close(): Unit
|
public actual fun close(): Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("2.0")
|
||||||
@ExperimentalStdlibApi
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public actual inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
public actual inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
||||||
contract {
|
contract {
|
||||||
@@ -32,7 +32,6 @@ public actual inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExperimentalStdlibApi
|
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("1.8")
|
||||||
@PublishedApi
|
@PublishedApi
|
||||||
internal fun AutoCloseable?.closeFinally(cause: Throwable?): Unit = when {
|
internal fun AutoCloseable?.closeFinally(cause: Throwable?): Unit = when {
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ package kotlin
|
|||||||
import kotlin.contracts.InvocationKind
|
import kotlin.contracts.InvocationKind
|
||||||
import kotlin.contracts.contract
|
import kotlin.contracts.contract
|
||||||
|
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("2.0")
|
||||||
@ExperimentalStdlibApi
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
public actual interface AutoCloseable {
|
public actual interface AutoCloseable {
|
||||||
public actual fun close(): Unit
|
public actual fun close(): Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("2.0")
|
||||||
@ExperimentalStdlibApi
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public actual inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
public actual inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
||||||
contract {
|
contract {
|
||||||
@@ -33,7 +33,6 @@ public actual inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("1.8")
|
||||||
@ExperimentalStdlibApi
|
|
||||||
@PublishedApi
|
@PublishedApi
|
||||||
internal fun AutoCloseable?.closeFinally(cause: Throwable?): Unit = when {
|
internal fun AutoCloseable?.closeFinally(cause: Throwable?): Unit = when {
|
||||||
this == null -> {}
|
this == null -> {}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import kotlin.contracts.contract
|
|||||||
* A resource that can be closed or released.
|
* A resource that can be closed or released.
|
||||||
*/
|
*/
|
||||||
@Suppress("NO_ACTUAL_FOR_EXPECT")
|
@Suppress("NO_ACTUAL_FOR_EXPECT")
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("2.0")
|
||||||
@ExperimentalStdlibApi
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
public expect interface AutoCloseable {
|
public expect interface AutoCloseable {
|
||||||
/**
|
/**
|
||||||
* Closes this resource.
|
* Closes this resource.
|
||||||
@@ -43,8 +43,8 @@ public expect interface AutoCloseable {
|
|||||||
* @return the result of [block] function invoked on this resource.
|
* @return the result of [block] function invoked on this resource.
|
||||||
*/
|
*/
|
||||||
@Suppress("NO_ACTUAL_FOR_EXPECT", "EXPECTED_DECLARATION_WITH_BODY")
|
@Suppress("NO_ACTUAL_FOR_EXPECT", "EXPECTED_DECLARATION_WITH_BODY")
|
||||||
@SinceKotlin("1.8")
|
@SinceKotlin("2.0")
|
||||||
@ExperimentalStdlibApi
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public expect inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
public expect inline fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R {
|
||||||
contract {
|
contract {
|
||||||
|
|||||||
Reference in New Issue
Block a user