diff --git a/compiler/testData/codegen/box/assert/alwaysEnable.kt b/compiler/testData/codegen/box/assert/alwaysEnable.kt index 1f8152dec33..bbb81fbab3c 100644 --- a/compiler/testData/codegen/box/assert/alwaysEnable.kt +++ b/compiler/testData/codegen/box/assert/alwaysEnable.kt @@ -5,6 +5,8 @@ // ASSERTIONS_MODE: always-enable // WITH_STDLIB +@file:Suppress("OPT_IN_USAGE_ERROR") // ExperimentalNativeApi is defined only in Native + fun checkTrue(): Boolean { var hit = false val l = { hit = true; true } diff --git a/compiler/testData/codegen/box/regressions/kt2246.kt b/compiler/testData/codegen/box/regressions/kt2246.kt index 73aafe18274..88b5932bc6f 100644 --- a/compiler/testData/codegen/box/regressions/kt2246.kt +++ b/compiler/testData/codegen/box/regressions/kt2246.kt @@ -6,6 +6,7 @@ // WITH_STDLIB +@Suppress("OPT_IN_USAGE_ERROR") // ExperimentalNativeApi is defined only in Native fun box(): String { kotlin.assert(true) return "OK" diff --git a/compiler/testData/codegen/box/volatile/messagePassing.kt b/compiler/testData/codegen/box/volatile/messagePassing.kt index 8a8810edc83..afce95f5e7b 100644 --- a/compiler/testData/codegen/box/volatile/messagePassing.kt +++ b/compiler/testData/codegen/box/volatile/messagePassing.kt @@ -10,6 +10,7 @@ import kotlin.concurrent.* var y = -1 fun box() : String { + @OptIn(kotlin.experimental.ExperimentalNativeApi::class) if (Platform.memoryModel != MemoryModel.EXPERIMENTAL) { // The test doesn't make sense for legacy mm, you can't have anything non-atomic to protect with @Volatile var return "OK" diff --git a/kotlin-native/backend.native/tests/codegen/enum/isFrozen.kt b/kotlin-native/backend.native/tests/codegen/enum/isFrozen.kt index 470401ff5a9..b79747d68aa 100644 --- a/kotlin-native/backend.native/tests/codegen/enum/isFrozen.kt +++ b/kotlin-native/backend.native/tests/codegen/enum/isFrozen.kt @@ -2,7 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class) +@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class) package codegen.enum.isFrozen import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/codegen/initializers/static.kt b/kotlin-native/backend.native/tests/codegen/initializers/static.kt index 75cc82e8a4f..0576c4187f5 100644 --- a/kotlin-native/backend.native/tests/codegen/initializers/static.kt +++ b/kotlin-native/backend.native/tests/codegen/initializers/static.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -@file:OptIn(kotlin.ExperimentalStdlibApi::class) +@file:OptIn(kotlin.ExperimentalStdlibApi::class, kotlin.experimental.ExperimentalNativeApi::class) package codegen.initializers.static diff --git a/kotlin-native/backend.native/tests/codegen/intrinsics/isExperimentalMM.kt b/kotlin-native/backend.native/tests/codegen/intrinsics/isExperimentalMM.kt index ae93fb6d8f8..3bb94999d99 100644 --- a/kotlin-native/backend.native/tests/codegen/intrinsics/isExperimentalMM.kt +++ b/kotlin-native/backend.native/tests/codegen/intrinsics/isExperimentalMM.kt @@ -2,6 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/codegen/kclass/kclass1.kt b/kotlin-native/backend.native/tests/codegen/kclass/kclass1.kt index d98726cb0f2..2af152c829c 100644 --- a/kotlin-native/backend.native/tests/codegen/kclass/kclass1.kt +++ b/kotlin-native/backend.native/tests/codegen/kclass/kclass1.kt @@ -34,6 +34,7 @@ fun dsl(block: DslMain.() -> T): T = DslMain().block() class TestClass +@OptIn(kotlin.experimental.ExperimentalNativeApi::class) class App(testQualified: Boolean) { var type = dsl { diff --git a/kotlin-native/backend.native/tests/codegen/objectDeclaration/isFrozen.kt b/kotlin-native/backend.native/tests/codegen/objectDeclaration/isFrozen.kt index 2adbdf9affd..ade756bed92 100644 --- a/kotlin-native/backend.native/tests/codegen/objectDeclaration/isFrozen.kt +++ b/kotlin-native/backend.native/tests/codegen/objectDeclaration/isFrozen.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class) +@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class) package codegen.objectDeclaration.isFrozen import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.kt b/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.kt index 7a464adb20e..4ca068f269b 100644 --- a/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.kt +++ b/kotlin-native/backend.native/tests/datagen/rtti/vtable_any.kt @@ -2,6 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package datagen.rtti.vtable_any diff --git a/kotlin-native/backend.native/tests/framework/kt42397/knlibrary.kt b/kotlin-native/backend.native/tests/framework/kt42397/knlibrary.kt index 06efdf7daca..f3c140b0c7f 100644 --- a/kotlin-native/backend.native/tests/framework/kt42397/knlibrary.kt +++ b/kotlin-native/backend.native/tests/framework/kt42397/knlibrary.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.native.Platform // The following 2 singletons are unused. However, since we are generating ObjC bindings for them, diff --git a/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.kt b/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.kt index d7efee581da..0ef16a3c666 100644 --- a/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.kt +++ b/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.kt @@ -2,6 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) fun inner1() : Nothing { throw Exception() diff --git a/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.swift b/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.swift index a1355a358aa..efab9adc35f 100644 --- a/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.swift +++ b/kotlin-native/backend.native/tests/framework/stacktrace/stacktrace.swift @@ -5,8 +5,8 @@ func testStackTrace() throws { let trace = StacktraceKt.getStackTrace() try assertTrue(trace[0].contains("Throwable.kt")) try assertTrue(trace[1].contains("Exceptions.kt")) - try assertTrue(trace[2].contains("stacktrace.kt:7")) - try assertTrue(trace[3].contains("stacktrace.kt:12")) + try assertTrue(trace[2].contains("stacktrace.kt:8")) + try assertTrue(trace[3].contains("stacktrace.kt:13")) try assertTrue(trace[4].contains("")) try assertTrue(trace[5].contains("stacktrace.swift:5")) try assertTrue(trace[6].contains("main.swift")) diff --git a/kotlin-native/backend.native/tests/framework/stacktraceBridges/stacktraceBridges.kt b/kotlin-native/backend.native/tests/framework/stacktraceBridges/stacktraceBridges.kt index 0aecd9a04ea..38df3833177 100644 --- a/kotlin-native/backend.native/tests/framework/stacktraceBridges/stacktraceBridges.kt +++ b/kotlin-native/backend.native/tests/framework/stacktraceBridges/stacktraceBridges.kt @@ -2,6 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) fun thrower() : Nothing { throw Exception() diff --git a/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.kt b/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.kt index 03635e59637..23261093ccb 100644 --- a/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.kt +++ b/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.kt @@ -2,6 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) inline fun inner2() : Nothing { throw Exception() diff --git a/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.swift b/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.swift index 8343c48f979..bff17ba629d 100644 --- a/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.swift +++ b/kotlin-native/backend.native/tests/framework/stacktraceByLibbacktrace/stacktraceByLibbacktrace.swift @@ -3,10 +3,10 @@ import StacktraceByLibbacktrace func testStackTrace() throws { let trace = StacktraceByLibbacktraceKt.getStackTrace() - try assertTrue(trace[0].contains("stacktraceByLibbacktrace.kt:7")) + try assertTrue(trace[0].contains("stacktraceByLibbacktrace.kt:8")) try assertTrue(trace[0].contains("[inlined]")) - try assertTrue(trace[1].contains("stacktraceByLibbacktrace.kt:11")) - try assertTrue(trace[2].contains("stacktraceByLibbacktrace.kt:16")) + try assertTrue(trace[1].contains("stacktraceByLibbacktrace.kt:12")) + try assertTrue(trace[2].contains("stacktraceByLibbacktrace.kt:17")) try assertTrue(trace[3].contains("")) try assertTrue(trace[4].contains("stacktraceByLibbacktrace.swift:5")) try assertTrue(trace[5].contains("main.swift:126")) diff --git a/kotlin-native/backend.native/tests/interop/basics/available_processors.kt b/kotlin-native/backend.native/tests/interop/basics/available_processors.kt index d1a48d348c4..12e3a830582 100644 --- a/kotlin-native/backend.native/tests/interop/basics/available_processors.kt +++ b/kotlin-native/backend.native/tests/interop/basics/available_processors.kt @@ -2,7 +2,7 @@ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class) import kotlin.native.* import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/interop/basics/globals.kt b/kotlin-native/backend.native/tests/interop/basics/globals.kt index dbb6696d925..df57370636a 100644 --- a/kotlin-native/backend.native/tests/interop/basics/globals.kt +++ b/kotlin-native/backend.native/tests/interop/basics/globals.kt @@ -2,7 +2,7 @@ * Copyright 2010-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class) import kotlinx.cinterop.* import cglobals.* diff --git a/kotlin-native/backend.native/tests/interop/basics/macros.kt b/kotlin-native/backend.native/tests/interop/basics/macros.kt index accb2730d87..6a15b8598d5 100644 --- a/kotlin-native/backend.native/tests/interop/basics/macros.kt +++ b/kotlin-native/backend.native/tests/interop/basics/macros.kt @@ -2,7 +2,7 @@ * Copyright 2010-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class) import kotlin.test.* import cmacros.* diff --git a/kotlin-native/backend.native/tests/interop/basics/union.kt b/kotlin-native/backend.native/tests/interop/basics/union.kt index ec115ff1766..b6633800aa5 100644 --- a/kotlin-native/backend.native/tests/interop/basics/union.kt +++ b/kotlin-native/backend.native/tests/interop/basics/union.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class) import cunion.* import kotlinx.cinterop.* diff --git a/kotlin-native/backend.native/tests/interop/basics/vectors.kt b/kotlin-native/backend.native/tests/interop/basics/vectors.kt index d7ec77daf07..afd227fd9bb 100644 --- a/kotlin-native/backend.native/tests/interop/basics/vectors.kt +++ b/kotlin-native/backend.native/tests/interop/basics/vectors.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class) import kotlinx.cinterop.* import kotlin.native.* diff --git a/kotlin-native/backend.native/tests/interop/kt42397/knlibrary.kt b/kotlin-native/backend.native/tests/interop/kt42397/knlibrary.kt index f58807bc0c1..dfc2c06951a 100644 --- a/kotlin-native/backend.native/tests/interop/kt42397/knlibrary.kt +++ b/kotlin-native/backend.native/tests/interop/kt42397/knlibrary.kt @@ -1,3 +1,4 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package knlibrary import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/interop/kt56182_package1lvl/knlibrary.kt b/kotlin-native/backend.native/tests/interop/kt56182_package1lvl/knlibrary.kt index 3a5bda9ae83..7d064168efe 100644 --- a/kotlin-native/backend.native/tests/interop/kt56182_package1lvl/knlibrary.kt +++ b/kotlin-native/backend.native/tests/interop/kt56182_package1lvl/knlibrary.kt @@ -1,5 +1,6 @@ // This test is similar to kt42397, just everything is doubled: in "package knlibrary" and the root package +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package knlibrary import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/interop/kt56182_root/knlibrary.kt b/kotlin-native/backend.native/tests/interop/kt56182_root/knlibrary.kt index eda4a1dc2af..5cbf1efeb88 100644 --- a/kotlin-native/backend.native/tests/interop/kt56182_root/knlibrary.kt +++ b/kotlin-native/backend.native/tests/interop/kt56182_root/knlibrary.kt @@ -1,5 +1,7 @@ // This test is similar to kt42397, just everything is in root package instead of "package knlibrary" +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.native.Platform // The following 2 singletons are unused. However, since we are generating C bindings for them, diff --git a/kotlin-native/backend.native/tests/interop/kt56182_root_package1lvl/knlibrary.kt b/kotlin-native/backend.native/tests/interop/kt56182_root_package1lvl/knlibrary.kt index f196b2167f1..4e0c8d619c2 100644 --- a/kotlin-native/backend.native/tests/interop/kt56182_root_package1lvl/knlibrary.kt +++ b/kotlin-native/backend.native/tests/interop/kt56182_root_package1lvl/knlibrary.kt @@ -1,6 +1,7 @@ // This test is similar to kt42397, just everything is doubled: in "package knlibrary.subpackage" and the root package // FILE: FirstLevelPackage.kt +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package knlibrary import kotlin.native.Platform @@ -19,6 +20,8 @@ fun enableMemoryChecker() { } // FILE: rootPackage.kt +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + object A {} class B { diff --git a/kotlin-native/backend.native/tests/interop/kt56182_root_subpackage2lvl/knlibrary.kt b/kotlin-native/backend.native/tests/interop/kt56182_root_subpackage2lvl/knlibrary.kt index 6847aeaacad..12e48db5d5f 100644 --- a/kotlin-native/backend.native/tests/interop/kt56182_root_subpackage2lvl/knlibrary.kt +++ b/kotlin-native/backend.native/tests/interop/kt56182_root_subpackage2lvl/knlibrary.kt @@ -1,6 +1,7 @@ // This test is similar to kt42397, just everything is doubled: in "package knlibrary.subpackage" and the root package // FILE: SecondLevelPackage.kt +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package knlibrary.subpackage import kotlin.native.Platform @@ -19,6 +20,8 @@ fun enableMemoryChecker() { } // FILE: rootPackage.kt +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + object A {} class B { diff --git a/kotlin-native/backend.native/tests/interop/kt56182_subpackage2lvl/knlibrary.kt b/kotlin-native/backend.native/tests/interop/kt56182_subpackage2lvl/knlibrary.kt index 88b182a214e..39201cb561b 100644 --- a/kotlin-native/backend.native/tests/interop/kt56182_subpackage2lvl/knlibrary.kt +++ b/kotlin-native/backend.native/tests/interop/kt56182_subpackage2lvl/knlibrary.kt @@ -1,4 +1,5 @@ // This test is similar to kt42397, just everything is in "package knlibrary.subpackage" instead of "package knlibrary" +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package knlibrary.subpackage import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt index 728df757229..cc4c4c390bd 100644 --- a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt +++ b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/checked.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import leakMemory.* import kotlin.native.concurrent.* diff --git a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt index a7dfb14e974..0caa39536aa 100644 --- a/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt +++ b/kotlin-native/backend.native/tests/interop/leakMemoryWithRunningThread/unchecked.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import leakMemory.* import kotlin.native.concurrent.* diff --git a/kotlin-native/backend.native/tests/interop/objc/kt42172/main.kt b/kotlin-native/backend.native/tests/interop/objc/kt42172/main.kt index 81afe21686f..a1d05db3473 100644 --- a/kotlin-native/backend.native/tests/interop/objc/kt42172/main.kt +++ b/kotlin-native/backend.native/tests/interop/objc/kt42172/main.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class) import objclib.* import kotlin.native.concurrent.* diff --git a/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt b/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt index eca4bdee3ae..c9500698f21 100644 --- a/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt +++ b/kotlin-native/backend.native/tests/interop/objc/kt56402/main.kt @@ -2,6 +2,7 @@ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import objclib.* diff --git a/kotlin-native/backend.native/tests/interop/objc/smoke.kt b/kotlin-native/backend.native/tests/interop/objc/smoke.kt index 1dd71a645c2..3d9fb5e5c91 100644 --- a/kotlin-native/backend.native/tests/interop/objc/smoke.kt +++ b/kotlin-native/backend.native/tests/interop/objc/smoke.kt @@ -2,7 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlinx.cinterop.* import objcSmoke.* diff --git a/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt b/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt index 1dd71a645c2..3d9fb5e5c91 100644 --- a/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt +++ b/kotlin-native/backend.native/tests/interop/objc/smoke_noopgc.kt @@ -2,7 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlinx.cinterop.* import objcSmoke.* diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/detachObjCObject.kt b/kotlin-native/backend.native/tests/interop/objc/tests/detachObjCObject.kt index 614f13c3637..ebe51573a48 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/detachObjCObject.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/detachObjCObject.kt @@ -2,6 +2,7 @@ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.test.* import kotlin.native.ref.WeakReference diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/kt41811.kt b/kotlin-native/backend.native/tests/interop/objc/tests/kt41811.kt index 752f0dc4ab1..cd7f48da7ca 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/kt41811.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/kt41811.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.native.ref.WeakReference import kotlinx.cinterop.* diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/main.kt b/kotlin-native/backend.native/tests/interop/objc/tests/main.kt index 178c49725de..a785df5e774 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/main.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/main.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.system.exitProcess import kotlinx.cinterop.autoreleasepool import kotlin.native.internal.test.testLauncherEntryPoint diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/sharing.kt b/kotlin-native/backend.native/tests/interop/objc/tests/sharing.kt index ebe04c3c886..aafafcadad6 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/sharing.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/sharing.kt @@ -1,4 +1,4 @@ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) import kotlinx.cinterop.* import kotlin.native.concurrent.* diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/weakRefs.kt b/kotlin-native/backend.native/tests/interop/objc/tests/weakRefs.kt index 3d863229d3b..612e6077d25 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/weakRefs.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/weakRefs.kt @@ -1,4 +1,4 @@ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.native.ref.* import kotlinx.cinterop.* diff --git a/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.kt b/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.kt index fc7dd5e1de7..93387a16e6a 100644 --- a/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.kt +++ b/kotlin-native/backend.native/tests/interop/objc_with_initializer/objc_test.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import objc_misc.* import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/interop/threadStates/unhandledException.kt b/kotlin-native/backend.native/tests/interop/threadStates/unhandledException.kt index 1d6f79b56ae..e894033a809 100644 --- a/kotlin-native/backend.native/tests/interop/threadStates/unhandledException.kt +++ b/kotlin-native/backend.native/tests/interop/threadStates/unhandledException.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -@file:OptIn(FreezingIsDeprecated::class, ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.native.concurrent.* import kotlin.native.runtime.Debugging diff --git a/kotlin-native/backend.native/tests/interop/threadStates/unhandledExceptionInForeignThread.kt b/kotlin-native/backend.native/tests/interop/threadStates/unhandledExceptionInForeignThread.kt index 82a71a7cf71..471652f51be 100644 --- a/kotlin-native/backend.native/tests/interop/threadStates/unhandledExceptionInForeignThread.kt +++ b/kotlin-native/backend.native/tests/interop/threadStates/unhandledExceptionInForeignThread.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -@file:OptIn(FreezingIsDeprecated::class, ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.native.concurrent.* import kotlin.native.runtime.Debugging diff --git a/kotlin-native/backend.native/tests/objcexport/coroutines.kt b/kotlin-native/backend.native/tests/objcexport/coroutines.kt index 6e5259957f3..b410bf98b9e 100644 --- a/kotlin-native/backend.native/tests/objcexport/coroutines.kt +++ b/kotlin-native/backend.native/tests/objcexport/coroutines.kt @@ -244,4 +244,5 @@ fun createCoroutineUninterceptedAndResume(fn: suspend () -> Any?, resultHolder: fun createCoroutineUninterceptedAndResume(fn: suspend Any?.() -> Any?, receiver: Any?, resultHolder: ResultHolder) = fn.createCoroutine(receiver, ResultHolderCompletion(resultHolder)).resume(Unit) +@OptIn(kotlin.native.runtime.NativeRuntimeApi::class) fun gc() = kotlin.native.runtime.GC.collect() diff --git a/kotlin-native/backend.native/tests/objcexport/deallocRetain.kt b/kotlin-native/backend.native/tests/objcexport/deallocRetain.kt index 5ed8b84dc6e..b01402f0b20 100644 --- a/kotlin-native/backend.native/tests/objcexport/deallocRetain.kt +++ b/kotlin-native/backend.native/tests/objcexport/deallocRetain.kt @@ -3,6 +3,7 @@ * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package deallocretain open class DeallocRetainBase diff --git a/kotlin-native/backend.native/tests/objcexport/noAutorelease.kt b/kotlin-native/backend.native/tests/objcexport/noAutorelease.kt index 652ac291b45..99e0fa2487f 100644 --- a/kotlin-native/backend.native/tests/objcexport/noAutorelease.kt +++ b/kotlin-native/backend.native/tests/objcexport/noAutorelease.kt @@ -6,6 +6,7 @@ import kotlin.native.internal.NativePtr import kotlin.native.ref.WeakReference import kotlin.test.* +@OptIn(kotlin.experimental.ExperimentalNativeApi::class) class KotlinLivenessTracker { val weakRefs = mutableListOf>() diff --git a/kotlin-native/backend.native/tests/objcexport/values.kt b/kotlin-native/backend.native/tests/objcexport/values.kt index 6feabe7a936..ba783ddc151 100644 --- a/kotlin-native/backend.native/tests/objcexport/values.kt +++ b/kotlin-native/backend.native/tests/objcexport/values.kt @@ -5,7 +5,7 @@ // All classes and methods should be used in tests @file:Suppress("UNUSED") -@file:OptIn(FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class) package conversions @@ -251,6 +251,7 @@ fun IC3.getValue3() = value fun IC3?.getValueOrNull3() = this?.value fun isFrozen(obj: Any): Boolean = obj.isFrozen +@OptIn(kotlin.experimental.ExperimentalNativeApi::class) fun isFreezingEnabled() = Platform.isFreezingEnabled fun kotlinLambda(block: (Any) -> Any): Any = block diff --git a/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt b/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt index 2d241525ed2..a4660b48206 100644 --- a/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt +++ b/kotlin-native/backend.native/tests/runtime/atomics/atomic0.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) package runtime.atomics.atomic0 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/basic/assert_failed.kt b/kotlin-native/backend.native/tests/runtime/basic/assert_failed.kt index e8f91168394..becb0e81d67 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/assert_failed.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/assert_failed.kt @@ -2,6 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) fun main(args: Array) { assert(false) diff --git a/kotlin-native/backend.native/tests/runtime/basic/assert_passed.kt b/kotlin-native/backend.native/tests/runtime/basic/assert_passed.kt index d49eacc0642..9dca874b92a 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/assert_passed.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/assert_passed.kt @@ -2,6 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) fun main(args: Array) { assert(true) diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt index 1b2a752337d..7863e5fb757 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_basic.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class, +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class) package runtime.basic.cleaner_basic diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.kt index 7cb79424169..397d2dbaa65 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_with_checker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.native.ref.Cleaner import kotlin.native.ref.createCleaner diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_without_checker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_without_checker.kt index c8463daaad9..6bd1005c893 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_without_checker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_main_without_checker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.native.ref.createCleaner import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_with_checker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_with_checker.kt index 5c893021335..7478e31d307 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_with_checker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_with_checker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_without_checker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_without_checker.kt index 82da27b8ca6..1a3fe810ad4 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_without_checker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_main_without_checker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt index dae92c720e0..c757d47c7c0 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_in_tls_worker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_with_checker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_with_checker.kt index 8a2d5909de0..be422caeeee 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_with_checker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_with_checker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_without_checker.kt b/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_without_checker.kt index 1c9cf7fef0b..b034df09e96 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_without_checker.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/cleaner_leak_without_checker.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/collections/array5.kt b/kotlin-native/backend.native/tests/runtime/collections/array5.kt index 0128eaa0db0..b56998951cf 100644 --- a/kotlin-native/backend.native/tests/runtime/collections/array5.kt +++ b/kotlin-native/backend.native/tests/runtime/collections/array5.kt @@ -2,7 +2,7 @@ * Copyright 2010-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class) package runtime.collections.array5 diff --git a/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt b/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt index eb5c46be882..a5ab90aefdc 100644 --- a/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt +++ b/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt @@ -5,8 +5,6 @@ package runtime.collections.hash_map1 -import kotlin.native.MemoryModel -import kotlin.native.Platform import kotlin.test.* fun assertTrue(cond: Boolean) { diff --git a/kotlin-native/backend.native/tests/runtime/collections/typed_array0.kt b/kotlin-native/backend.native/tests/runtime/collections/typed_array0.kt index e2baf4f40d9..eea1fd7f4bb 100644 --- a/kotlin-native/backend.native/tests/runtime/collections/typed_array0.kt +++ b/kotlin-native/backend.native/tests/runtime/collections/typed_array0.kt @@ -2,6 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package runtime.collections.typed_array0 diff --git a/kotlin-native/backend.native/tests/runtime/collections/typed_array1.kt b/kotlin-native/backend.native/tests/runtime/collections/typed_array1.kt index c21af9769a1..5a8cac2d01c 100644 --- a/kotlin-native/backend.native/tests/runtime/collections/typed_array1.kt +++ b/kotlin-native/backend.native/tests/runtime/collections/typed_array1.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) package runtime.collections.typed_array1 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt b/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt index 9036516069f..535e2a723e6 100644 --- a/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt +++ b/kotlin-native/backend.native/tests/runtime/concurrent/worker_bound_reference0.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class) package runtime.concurrent.worker_bound_reference0 diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt b/kotlin-native/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt index 19ce86f2019..2488a0525e2 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/check_stacktrace_format.kt @@ -2,6 +2,8 @@ // "\tat 1 main.kexe\t\t 0x000000010d7cdb4c kfun:package.function(kotlin.Int) + 108 (/path/to/file/name.kt:10:27)\n" // If test is broken, org.jetbrains.kotlin.idea.filters.KotlinExceptionFilter (in main Kotlin repo) should be updated. +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.test.* import kotlin.text.Regex diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_get.kt b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_get.kt index e5e8336fb7c..c32a2aff635 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_get.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_get.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_no_reset.kt b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_no_reset.kt index 6a284e3f931..50b625987e4 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_no_reset.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_no_reset.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate.kt b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate.kt index 22d315fee29..b6488fe2c79 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate_unhandled_exception.kt b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate_unhandled_exception.kt index e78b921642b..351f5125a06 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate_unhandled_exception.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate_unhandled_exception.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt index b448aea61f3..4c598c6ea75 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_unhandled_exception.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/except_constr_w_default.kt b/kotlin-native/backend.native/tests/runtime/exceptions/except_constr_w_default.kt index e07d0b9b243..74ecf48770e 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/except_constr_w_default.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/except_constr_w_default.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.text.Regex import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/kt-37572.kt b/kotlin-native/backend.native/tests/runtime/exceptions/kt-37572.kt index aa8f6deef1d..a18f6e37eee 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/kt-37572.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/kt-37572.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.text.Regex import kotlin.test.* @@ -44,14 +46,14 @@ internal val regex = Regex("^(\\d+)\\ +.*/(.*):(\\d+):.*$") internal fun checkFrame(value:String) { val goldValues = arrayOf?>( *arrayOfNulls(expectedExceptionContrFrames), - "kt-37572.kt" to 40, - "kt-37572.kt" to 31, + "kt-37572.kt" to 42, + "kt-37572.kt" to 33, *(if (expectedInlinesCount != 0) arrayOf( - "kt-37572.kt" to 36, - "kt-37572.kt" to 29, + "kt-37572.kt" to 38, + "kt-37572.kt" to 31, ) else emptyArray()), - "kt-37572.kt" to 19, - "kt-37572.kt" to 7) + "kt-37572.kt" to 21, + "kt-37572.kt" to 9) val (pos, file, line) = regex.find(value)!!.destructured goldValues[pos.toInt()]?.let { diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/kt-49240-stack-trace-completeness.kt b/kotlin-native/backend.native/tests/runtime/exceptions/kt-49240-stack-trace-completeness.kt index bdda0adbcd5..17d030f0f2b 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/kt-49240-stack-trace-completeness.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/kt-49240-stack-trace-completeness.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.text.Regex import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/stack_trace_inline.kt b/kotlin-native/backend.native/tests/runtime/exceptions/stack_trace_inline.kt index e41137dcd82..dde60fed33f 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/stack_trace_inline.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/stack_trace_inline.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.text.Regex import kotlin.test.* @@ -34,8 +36,8 @@ internal fun checkFrame(value:String) { val goldValues = arrayOf?>( *arrayOfNulls(expectedExceptionContrFrames), *arrayOfNulls(expectedInlinesCount), - "stack_trace_inline.kt" to 8, - "stack_trace_inline.kt" to 23) + "stack_trace_inline.kt" to 10, + "stack_trace_inline.kt" to 25) val (pos, file, line) = regex.find(value)!!.destructured goldValues[pos.toInt()]?.let { assertEquals(it.first, file) diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/terminate.kt b/kotlin-native/backend.native/tests/runtime/exceptions/terminate.kt index 55926607e26..fc48edfd8ca 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/terminate.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/terminate.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/throw_from_except_constr.kt b/kotlin-native/backend.native/tests/runtime/exceptions/throw_from_except_constr.kt index 9c875d1e057..fa280dbbc16 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/throw_from_except_constr.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/throw_from_except_constr.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.text.Regex import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/exceptions/unhandled_exception.kt b/kotlin-native/backend.native/tests/runtime/exceptions/unhandled_exception.kt index 526946def26..cf0c135c85b 100644 --- a/kotlin-native/backend.native/tests/runtime/exceptions/unhandled_exception.kt +++ b/kotlin-native/backend.native/tests/runtime/exceptions/unhandled_exception.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(ExperimentalStdlibApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/memory/leak_memory.kt b/kotlin-native/backend.native/tests/runtime/memory/leak_memory.kt index 0d6351cfaa5..600321eceb4 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/leak_memory.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/leak_memory.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlinx.cinterop.* import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/runtime/memory/leak_memory_test_runner.kt b/kotlin-native/backend.native/tests/runtime/memory/leak_memory_test_runner.kt index 5facc72141b..bfd109cae66 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/leak_memory_test_runner.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/leak_memory_test_runner.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.test.* import kotlinx.cinterop.* diff --git a/kotlin-native/backend.native/tests/runtime/memory/stable_ref_cross_thread_check.kt b/kotlin-native/backend.native/tests/runtime/memory/stable_ref_cross_thread_check.kt index 388d16a7e71..4dc2ee2b568 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/stable_ref_cross_thread_check.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/stable_ref_cross_thread_check.kt @@ -2,7 +2,7 @@ * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class, kotlinx.cinterop.ExperimentalForeignApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class, kotlinx.cinterop.ExperimentalForeignApi::class) package runtime.memory.stable_ref_cross_thread_check diff --git a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt index 6fdb6aa875c..1aba0013850 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt @@ -2,7 +2,7 @@ * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/text/chars0.kt b/kotlin-native/backend.native/tests/runtime/text/chars0.kt index dc7ead95562..7963474321d 100644 --- a/kotlin-native/backend.native/tests/runtime/text/chars0.kt +++ b/kotlin-native/backend.native/tests/runtime/text/chars0.kt @@ -2,6 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package runtime.text.chars0 diff --git a/kotlin-native/backend.native/tests/runtime/text/parse0.kt b/kotlin-native/backend.native/tests/runtime/text/parse0.kt index 7b22513d345..926ad5e4ae0 100644 --- a/kotlin-native/backend.native/tests/runtime/text/parse0.kt +++ b/kotlin-native/backend.native/tests/runtime/text/parse0.kt @@ -2,6 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package runtime.text.parse0 diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy1.kt b/kotlin-native/backend.native/tests/runtime/workers/lazy1.kt index 9249f990bf6..88a6da66c19 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/lazy1.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy1.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class) package runtime.workers.lazy1 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy3.kt b/kotlin-native/backend.native/tests/runtime/workers/lazy3.kt index e0b634b76c4..8b33cf19daa 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/lazy3.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy3.kt @@ -1,4 +1,4 @@ -@file:OptIn(FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class) import kotlin.native.concurrent.* import kotlin.native.ref.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt b/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt index e1ab33f2922..33788adff06 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/lazy4.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) package runtime.workers.lazy4 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/leak_memory_with_worker_termination.kt b/kotlin-native/backend.native/tests/runtime/workers/leak_memory_with_worker_termination.kt index 3460d2d8f36..774d05723e6 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/leak_memory_with_worker_termination.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/leak_memory_with_worker_termination.kt @@ -1,4 +1,4 @@ -@file:OptIn(ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class) import kotlin.native.concurrent.* import kotlin.native.Platform import kotlinx.cinterop.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/leak_worker.kt b/kotlin-native/backend.native/tests/runtime/workers/leak_worker.kt index 66272ac8306..20beeab01b0 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/leak_worker.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/leak_worker.kt @@ -1,4 +1,4 @@ -@file:OptIn(ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class) import kotlin.native.concurrent.* import kotlin.native.Platform import kotlinx.cinterop.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker11.kt b/kotlin-native/backend.native/tests/runtime/workers/worker11.kt index 14382d6cb1c..30542ba008a 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker11.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker11.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) package runtime.workers.worker11 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker3.kt b/kotlin-native/backend.native/tests/runtime/workers/worker3.kt index 6c22dc74282..a9a1d8fe747 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker3.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker3.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class) package runtime.workers.worker3 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker6.kt b/kotlin-native/backend.native/tests/runtime/workers/worker6.kt index 7b3c2668876..146488da499 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker6.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker6.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) package runtime.workers.worker6 import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt b/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt index 1f2773f2ad7..db57a385d33 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker9_experimentalMM.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) package runtime.workers.worker9_experimentalMM import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker_exception_messages.kt b/kotlin-native/backend.native/tests/runtime/workers/worker_exception_messages.kt index 7ec6a4353e2..be402e353c5 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker_exception_messages.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker_exception_messages.kt @@ -1,4 +1,4 @@ -@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class) package runtime.workers.worker_exception_messages import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/runtime/workers/worker_threadlocal_no_leak.kt b/kotlin-native/backend.native/tests/runtime/workers/worker_threadlocal_no_leak.kt index 9a3f32979f9..0d03366c333 100644 --- a/kotlin-native/backend.native/tests/runtime/workers/worker_threadlocal_no_leak.kt +++ b/kotlin-native/backend.native/tests/runtime/workers/worker_threadlocal_no_leak.kt @@ -3,7 +3,7 @@ * that can be found in the LICENSE file. */ -@file:OptIn(ObsoleteWorkersApi::class) +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class) import kotlin.native.concurrent.* import kotlin.native.Platform diff --git a/kotlin-native/backend.native/tests/sanity/assertions_enabled_for_local_tests.kt b/kotlin-native/backend.native/tests/sanity/assertions_enabled_for_local_tests.kt index 12620a5fc42..6b1a6e36928 100644 --- a/kotlin-native/backend.native/tests/sanity/assertions_enabled_for_local_tests.kt +++ b/kotlin-native/backend.native/tests/sanity/assertions_enabled_for_local_tests.kt @@ -1,3 +1,4 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package sanity.assertions_enabled import kotlin.test.Test diff --git a/kotlin-native/backend.native/tests/testing/custom_main.kt b/kotlin-native/backend.native/tests/testing/custom_main.kt index 50a52b21be6..51bb516689d 100644 --- a/kotlin-native/backend.native/tests/testing/custom_main.kt +++ b/kotlin-native/backend.native/tests/testing/custom_main.kt @@ -2,7 +2,7 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ - +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) package kotlin.test.tests import kotlin.test.* diff --git a/kotlin-native/backend.native/tests/testing/library_user.kt b/kotlin-native/backend.native/tests/testing/library_user.kt index ab5de47a748..0ceccebebe8 100644 --- a/kotlin-native/backend.native/tests/testing/library_user.kt +++ b/kotlin-native/backend.native/tests/testing/library_user.kt @@ -1,3 +1,5 @@ +@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class) + import kotlin.native.internal.test.* import kotlin.test.* import library.* diff --git a/libraries/stdlib/native-wasm/test/harmony_regex/AllCodePointsTest.kt b/libraries/stdlib/native-wasm/test/harmony_regex/AllCodePointsTest.kt index 451fbfc2d1a..79958334b84 100644 --- a/libraries/stdlib/native-wasm/test/harmony_regex/AllCodePointsTest.kt +++ b/libraries/stdlib/native-wasm/test/harmony_regex/AllCodePointsTest.kt @@ -25,6 +25,7 @@ class AllCodePointsTest { fun assertTrue(msg: String, value: Boolean) = assertTrue(value, msg) fun assertFalse(msg: String, value: Boolean) = assertFalse(value, msg) + @OptIn(kotlin.experimental.ExperimentalNativeApi::class) fun codePointToString(codePoint: Int): String { val charArray = Char.toChars(codePoint) return charArray.concatToString(0, charArray.size)