[K/N and WASM] Internalize NoWhenBranchMatchedException and UninitializedPropertyAccessException
As a part of efforts to stabilize Native stdlib. Merge-request: KT-MR-9531 Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
85450c93a6
commit
b65a68ca0d
@@ -20,6 +20,8 @@ class X {
|
|||||||
// MODULE: mainLib(lib)
|
// MODULE: mainLib(lib)
|
||||||
// FILE: mainLib.kt
|
// FILE: mainLib.kt
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
val x = X()
|
val x = X()
|
||||||
|
|
||||||
fun lib(): String {
|
fun lib(): String {
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
// WORKS_WHEN_VALUE_CLASS
|
// WORKS_WHEN_VALUE_CLASS
|
||||||
// LANGUAGE: +ValueClasses, +InlineLateinit
|
// LANGUAGE: +ValueClasses, +InlineLateinit
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||||
value class IC1(val x: String)
|
value class IC1(val x: String)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
lateinit var str: String
|
lateinit var str: String
|
||||||
try {
|
try {
|
||||||
|
|||||||
Vendored
+2
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
fun runNoInline(f: () -> Unit) = f()
|
fun runNoInline(f: () -> Unit) = f()
|
||||||
|
|||||||
+2
@@ -1,6 +1,8 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// WASM_MUTE_REASON: REFLECTION
|
// WASM_MUTE_REASON: REFLECTION
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
fun runNoInline(f: () -> Unit) = f()
|
fun runNoInline(f: () -> Unit) = f()
|
||||||
|
|||||||
+2
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
+2
@@ -10,6 +10,8 @@ object C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FILE: test.kt
|
// FILE: test.kt
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
+2
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
lateinit var str: String
|
lateinit var str: String
|
||||||
|
|||||||
+2
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import kotlin.UninitializedPropertyAccessException
|
import kotlin.UninitializedPropertyAccessException
|
||||||
|
|
||||||
lateinit var str: String
|
lateinit var str: String
|
||||||
|
|||||||
+1
-1
@@ -162,7 +162,7 @@ private class CustomThrowableFailure(private val checker: (Throwable) -> Boolean
|
|||||||
TestFailedWithException(t) // Unexpected type of exception.
|
TestFailedWithException(t) // Unexpected type of exception.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("PrivatePropertyName")
|
@Suppress("PrivatePropertyName", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
private val NoWhenBranchFailure = CustomThrowableFailure { it is NoWhenBranchMatchedException }
|
private val NoWhenBranchFailure = CustomThrowableFailure { it is NoWhenBranchMatchedException }
|
||||||
|
|
||||||
private sealed class Test {
|
private sealed class Test {
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* that can be found in the LICENSE file.
|
* that can be found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||||
|
|
||||||
import a.*
|
import a.*
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ public actual open class AssertionError : Error {
|
|||||||
constructor(message: String?, cause: Throwable?) : super(message, cause)
|
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()
|
actual constructor() : super()
|
||||||
|
|
||||||
@@ -142,7 +143,8 @@ public actual open class NoWhenBranchMatchedException : RuntimeException {
|
|||||||
actual constructor(cause: Throwable?) : super(cause)
|
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()
|
actual constructor() : super()
|
||||||
|
|
||||||
|
|||||||
@@ -95,14 +95,16 @@ public actual open class ArithmeticException : RuntimeException {
|
|||||||
public actual constructor(message: String?) : super(message)
|
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() : super()
|
||||||
public actual constructor(message: String?) : super(message)
|
public actual constructor(message: String?) : super(message)
|
||||||
public actual constructor(message: String?, cause: Throwable?) : super(message, cause)
|
public actual constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||||
public actual constructor(cause: Throwable?) : super(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() : super()
|
||||||
public actual constructor(message: String?) : super(message)
|
public actual constructor(message: String?) : super(message)
|
||||||
public actual constructor(message: String?, cause: Throwable?) : super(message, cause)
|
public actual constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||||
|
|||||||
Reference in New Issue
Block a user