Files
kotlin-fork/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInUnaryExpr.fir.kt
T
Andrey Zinovyev ec4cbfef59 [FIR] UNREACHABLE_CODE diagnostic (wip)
Implementation for PSI only
2021-08-04 14:42:24 +03:00

16 lines
367 B
Kotlin
Vendored

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