The right return

Report a typo

What will happen when the following function testFunc is called?

fun failFast(): Nothing {
    throw Exception("fail fast")
}

fun testFunc(flag: Boolean) {
    if (flag) {
        println("Flag is true")
    } else {
        failFast()
    }
    println("End of testFunc")
}
Select one or more options from the list

Create a free account to access the full topic