Files
kotlin/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInUnaryExpr.kt
Svetlana Isakova 79cec6411d Mark only unreachable parts of element if it has reachable parts
like for 'return todo()' mark only 'return'
2014-06-21 12:26:33 +04:00

15 lines
316 B
Kotlin

fun testPrefix() {
fun Any.not() {}
<!UNREACHABLE_CODE!>!<!>todo()
}
fun testPostfixWithCall(n: Nothing) {
fun Nothing.inc(): Nothing = this
n<!UNREACHABLE_CODE!>++<!>
}
fun testPostfixSpecial() {
todo()<!UNNECESSARY_NOT_NULL_ASSERTION, UNREACHABLE_CODE!>!!<!>
}
fun todo() = throw Exception()