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

25 lines
437 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
fun unreachable0() {
return
<!UNREACHABLE_CODE!>return todo()<!>
}
fun unreachable2() {
return
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>a<!> = todo()<!>
}
fun unreachable3() {
return
<!UNREACHABLE_CODE!>bar(todo())<!>
}
fun unreachable4(array: Array<Any>) {
return
<!UNREACHABLE_CODE!>array[todo()]<!>
}
fun bar(a: Any) {}
fun todo(): Nothing = throw Exception()