Files
Abduqodiri Qurbonzoda 5407ac1c72 [K/N] Mark UnhandledExceptionHook-related API with ExperimentalNativeApi
Instead of ExperimentalStdlibApi

As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-19 20:36:31 +00:00

13 lines
346 B
Kotlin

@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.concurrent.freeze
// KT-47828
fun setHookAndThrow() {
val hook = { _: Throwable ->
println("OK. Kotlin unhandled exception hook")
}
hook.freeze()
setUnhandledExceptionHook(hook)
throw Exception("Error")
}