Introduce kotlin.AutoCloseable typealias in K/JVM stdlib #KT-55777

This commit is contained in:
Abduqodiri Qurbonzoda
2024-02-25 16:04:16 +02:00
committed by Space Team
parent 98ad68eb90
commit 557ea32f87
3 changed files with 5 additions and 7 deletions
@@ -1,4 +1,4 @@
package
public fun foo(): kotlin.Int?
public inline fun </*0*/ T : java.lang.AutoCloseable, /*1*/ R> T.use(/*0*/ block: (T) -> R): R
public inline fun </*0*/ T : kotlin.AutoCloseable /* = java.lang.AutoCloseable */, /*1*/ R> T.use(/*0*/ block: (T) -> R): R
+1
View File
@@ -150,6 +150,7 @@ kotlin {
freeCompilerArgs.set(
listOfNotNull(
"-Xallow-kotlin-package",
"-Xexpect-actual-classes",
"-Xmultifile-parts-inherit",
"-Xno-new-java-annotation-targets",
"-Xexplicit-api=strict",
@@ -12,12 +12,9 @@ package kotlin
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
// TODO: Introduce this typealias when Common AutoCloseable is stabilized.
// This typealias shadows existing java.lang.AutoCloseable, and the experimental status would require
// opt-in in exiting usages (that are w/o package prefix). Hence it would break previously compilable code.
//@Suppress("ACTUAL_WITHOUT_EXPECT")
//@SinceKotlin("1.8")
//public actual typealias AutoCloseable = java.lang.AutoCloseable
@Suppress("ACTUAL_WITHOUT_EXPECT")
@SinceKotlin("2.0")
public actual typealias AutoCloseable = java.lang.AutoCloseable
@Suppress("ACTUAL_WITHOUT_EXPECT")
@SinceKotlin("1.2")