mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 00:21:35 +00:00
16 lines
346 B
Kotlin
Vendored
16 lines
346 B
Kotlin
Vendored
// See KT-10913 Bogus unreachable code warning
|
|
|
|
fun fn() : String? = null
|
|
|
|
inline fun <T, R> T.let(f: (T) -> R): R = f(this)
|
|
|
|
fun foo(): String {
|
|
val x = fn()?.let { throw Exception() } ?: "unreachable?"
|
|
return x
|
|
}
|
|
|
|
fun bar(): String {
|
|
val x = fn() ?: return ""
|
|
val y = x?.let { throw Exception() } ?: "unreachable"
|
|
return y
|
|
} |