Introduce exitProcess(status) returning Nothing.

#KT-10441 Fixed
This commit is contained in:
Ilya Gorbunov
2015-12-21 18:53:51 +03:00
parent 5a079defc7
commit 3ee9c2b9d8
@@ -0,0 +1,15 @@
@file:kotlin.jvm.JvmName("ProcessKt")
@file:kotlin.jvm.JvmVersion
package kotlin.system
/**
* Terminates the currently running Java Virtual Machine. The
* argument serves as a status code; by convention, a nonzero status
* code indicates abnormal termination.
*
* This method never returns normally.
*/
public fun exitProcess(status: Int): Nothing {
System.exit(status)
throw RuntimeException("System.exit returned normally, while it was supposed to halt JVM.")
}