Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Throw.kt
T
Svetlana Isakova 9904f21ceb added ThrowExceptionInstruction
(to store throw expression in it)
2012-12-18 16:00:26 +04:00

9 lines
214 B
Kotlin

fun bar(x: Int): RuntimeException = RuntimeException(x.toString())
fun foo() {
val x: Int? = null
if (x == null) throw bar(<!TYPE_MISMATCH!>x<!>)
throw bar(x)
<!UNREACHABLE_CODE!>throw bar(x)<!>
}