diff --git a/kotlin-native/backend.native/tests/interop/objc/tests/kt35544.kt b/kotlin-native/backend.native/tests/interop/objc/tests/kt35544.kt index df789abcbb9..26ebc26d94f 100644 --- a/kotlin-native/backend.native/tests/interop/objc/tests/kt35544.kt +++ b/kotlin-native/backend.native/tests/interop/objc/tests/kt35544.kt @@ -2,7 +2,7 @@ import kotlin.test.* import objcTests.* @Test fun testKT35544() { - val exception = assertFailsWith { + val exception = assertFailsWith { 123 as NSString } assertEquals("class kotlin.Int cannot be cast to class objcTests.NSString", exception.message) @@ -11,7 +11,7 @@ fun testKT35544() { val bundle35544: Any = NSBundle() @Test fun testKT35544runtime() { - val exception = assertFailsWith { + val exception = assertFailsWith { bundle35544 as NSString } assertEquals("class NSBundle cannot be cast to class objcTests.NSString", exception.message) diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt index 678199c761c..08b8e6f9105 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt @@ -106,7 +106,8 @@ public actual open class ClassCastException : RuntimeException { actual constructor(message: String?) : super(message) } -public open class TypeCastException : ClassCastException { +@PublishedApi +internal open class TypeCastException : ClassCastException { constructor() : super()