Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/bound/controlFlow.kt
T
Alexey Sedunov 2e76a76088 Control Flow: Fix CFG usage info for double-colon expressions
#KT-12551 Fixed
 #KT-17092 Fixed
2017-07-17 16:09:51 +03:00

23 lines
500 B
Kotlin
Vendored

fun unusedExpression(s: String) {
<!UNUSED_EXPRESSION!>s::hashCode<!>
<!UNUSED_EXPRESSION!>s::class<!>
}
fun noUnusedParameter(s: String): Int {
val f = s::hashCode
return f()
}
fun unreachableCode(): Int {
(if (true) return 1 else return 0)<!UNREACHABLE_CODE!>::toString<!>
<!UNREACHABLE_CODE!>return 0<!>
}
fun unreachableCodeInLoop(): Int {
while (true) {
(break)<!UNREACHABLE_CODE!>::toString<!>
<!UNREACHABLE_CODE!>return 1<!>
}
return 2
}