Files
kotlin-fork/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt
T
Dmitry Petrov df6d4f358a KT-22274 report warning on labels that can't be referenced
Labels are meaningful only if they can be referenced by 'break',
'continue', or 'return' expressions.
2018-07-25 12:08:20 +03:00

23 lines
540 B
Kotlin
Vendored

package a
fun test1() {
<!UNREACHABLE_CODE!>bar(<!>
11,
todo(),//comment1
<!UNREACHABLE_CODE!>""//comment2
)<!>
}
fun test2() {
<!UNREACHABLE_CODE!>bar(<!>11, todo()/*comment1*/, <!UNREACHABLE_CODE!>""/*comment2*/)<!>
}
fun test3() {
<!UNREACHABLE_CODE!>bar(<!>11, <!REDUNDANT_LABEL_WARNING!>l@<!>(todo()/*comment*/), <!UNREACHABLE_CODE!>"")<!>
}
fun todo(): Nothing = throw Exception()
fun bar(<!UNUSED_PARAMETER!>i<!>: Int, <!UNUSED_PARAMETER!>s<!>: String, <!UNUSED_PARAMETER!>a<!>: Any) {}