Control flow graph for safe calls corrected #KT-10913 Fixed

Also #KT-10186 Fixed
Also #KT-5198 Fixed
This commit is contained in:
Mikhail Glukhikh
2016-02-02 16:17:02 +03:00
committed by Mikhail Glukhikh
parent 5ae394fec0
commit a08b8f43b2
15 changed files with 660 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
// 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
}