diff --git a/compiler/testData/binaryCompatibility/klibEvolution/addLateinitToVar.kt b/compiler/testData/binaryCompatibility/klibEvolution/addLateinitToVar.kt index a2b4760e5fe..94460647a55 100644 --- a/compiler/testData/binaryCompatibility/klibEvolution/addLateinitToVar.kt +++ b/compiler/testData/binaryCompatibility/klibEvolution/addLateinitToVar.kt @@ -20,13 +20,15 @@ class X { // MODULE: mainLib(lib) // FILE: mainLib.kt +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + val x = X() fun lib(): String { val a = try { qux - } catch (e: UninitializedPropertyAccessException) { + } catch (e: UninitializedPropertyAccessException) { "uninitiaized" } diff --git a/compiler/testData/codegen/box/inlineClasses/lateinitInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/lateinitInlineClasses.kt index de210d50359..04a7f65f9eb 100644 --- a/compiler/testData/codegen/box/inlineClasses/lateinitInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/lateinitInlineClasses.kt @@ -2,6 +2,8 @@ // WORKS_WHEN_VALUE_CLASS // LANGUAGE: +ValueClasses, +InlineLateinit +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + OPTIONAL_JVM_INLINE_ANNOTATION value class IC1(val x: String) diff --git a/compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt b/compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt index 6b0c46f0f57..c7844292b0a 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt @@ -1,5 +1,7 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + fun box(): String { lateinit var str: String try { diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt index 5a13eda1104..aabcb83280a 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt @@ -1,5 +1,7 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException fun runNoInline(f: () -> Unit) = f() diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt index eb024f1d329..c28efe16048 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt @@ -1,6 +1,8 @@ // WITH_STDLIB // WASM_MUTE_REASON: REFLECTION +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException fun runNoInline(f: () -> Unit) = f() diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt index a47c3bdcab0..6c6bef5f361 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt @@ -1,5 +1,7 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException fun box(): String { diff --git a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt index a14f3470e2d..d7a04a42c18 100644 --- a/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt +++ b/compiler/testData/codegen/box/properties/lateinit/local/uninitializedRead.kt @@ -1,5 +1,7 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException fun box(): String { diff --git a/compiler/testData/codegen/box/properties/lateinit/localClass.kt b/compiler/testData/codegen/box/properties/lateinit/localClass.kt index ba7dafa6f79..23479f52e70 100644 --- a/compiler/testData/codegen/box/properties/lateinit/localClass.kt +++ b/compiler/testData/codegen/box/properties/lateinit/localClass.kt @@ -1,6 +1,8 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException fun box(): String { diff --git a/compiler/testData/codegen/box/properties/lateinit/topLevel/accessorException.kt b/compiler/testData/codegen/box/properties/lateinit/topLevel/accessorException.kt index 514f7f2de60..5610ae23ef4 100644 --- a/compiler/testData/codegen/box/properties/lateinit/topLevel/accessorException.kt +++ b/compiler/testData/codegen/box/properties/lateinit/topLevel/accessorException.kt @@ -10,6 +10,8 @@ object C { } // FILE: test.kt +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException fun box(): String { diff --git a/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt b/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt index 25d43c1aad3..5a81ca9cf7e 100644 --- a/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt +++ b/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt @@ -1,5 +1,7 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException lateinit var str: String diff --git a/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt b/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt index 66011112387..4ee705f08f4 100644 --- a/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt +++ b/compiler/testData/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt @@ -1,5 +1,7 @@ // WITH_STDLIB +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import kotlin.UninitializedPropertyAccessException lateinit var str: String diff --git a/compiler/testData/klibABI/__utils__/__utils__.kt b/compiler/testData/klibABI/__utils__/__utils__.kt index 6c391a5d0ef..2cf7dd417d4 100644 --- a/compiler/testData/klibABI/__utils__/__utils__.kt +++ b/compiler/testData/klibABI/__utils__/__utils__.kt @@ -162,7 +162,7 @@ private class CustomThrowableFailure(private val checker: (Throwable) -> Boolean TestFailedWithException(t) // Unexpected type of exception. } -@Suppress("PrivatePropertyName") +@Suppress("PrivatePropertyName", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") private val NoWhenBranchFailure = CustomThrowableFailure { it is NoWhenBranchMatchedException } private sealed class Test { diff --git a/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.kt b/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.kt index d4b1cb03c17..cb8fab5e905 100644 --- a/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.kt +++ b/kotlin-native/backend.native/tests/codegen/inline/lateinitProperty_linkTest_main.kt @@ -3,6 +3,8 @@ * that can be found in the LICENSE file. */ +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + import a.* fun main() { diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt index 08b8e6f9105..ab3b192a56d 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt @@ -131,7 +131,8 @@ public actual open class AssertionError : Error { constructor(message: String?, cause: Throwable?) : super(message, cause) } -public actual open class NoWhenBranchMatchedException : RuntimeException { +@Suppress("ACTUAL_WITHOUT_EXPECT") +internal actual open class NoWhenBranchMatchedException : RuntimeException { actual constructor() : super() @@ -142,7 +143,8 @@ public actual open class NoWhenBranchMatchedException : RuntimeException { actual constructor(cause: Throwable?) : super(cause) } -public actual open class UninitializedPropertyAccessException : RuntimeException { +@Suppress("ACTUAL_WITHOUT_EXPECT") +internal actual open class UninitializedPropertyAccessException : RuntimeException { actual constructor() : super() diff --git a/libraries/stdlib/wasm/src/kotlin/Exceptions.kt b/libraries/stdlib/wasm/src/kotlin/Exceptions.kt index f928e822444..966f88f6168 100644 --- a/libraries/stdlib/wasm/src/kotlin/Exceptions.kt +++ b/libraries/stdlib/wasm/src/kotlin/Exceptions.kt @@ -95,14 +95,16 @@ public actual open class ArithmeticException : RuntimeException { public actual constructor(message: String?) : super(message) } -public actual open class NoWhenBranchMatchedException : RuntimeException { +@Suppress("ACTUAL_WITHOUT_EXPECT") +internal actual open class NoWhenBranchMatchedException : RuntimeException { public actual constructor() : super() public actual constructor(message: String?) : super(message) public actual constructor(message: String?, cause: Throwable?) : super(message, cause) public actual constructor(cause: Throwable?) : super(cause) } -public actual open class UninitializedPropertyAccessException : RuntimeException { +@Suppress("ACTUAL_WITHOUT_EXPECT") +internal actual open class UninitializedPropertyAccessException : RuntimeException { public actual constructor() : super() public actual constructor(message: String?) : super(message) public actual constructor(message: String?, cause: Throwable?) : super(message, cause)