Files
kotlin/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.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

23 lines
347 B
Kotlin

package c
fun test1() {
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>r<!>: Nothing =<!> null!!
}
fun test2(a: A) {
a + a
<!UNREACHABLE_CODE!>bar()<!>
}
fun test3() {
null!!
<!UNREACHABLE_CODE!>bar()<!>
}
fun throwNPE() = null!!
class A {
fun plus(<!UNUSED_PARAMETER!>a<!>: A): Nothing = throw Exception()
}
fun bar() {}