[FIR][CFG] Partial support of postponed Nothing calls
In try blocks, last call won't be completed when building node for it This is workaround to partially reconstruct nothing stub node for such calls. Should work for non-local returns in try only. #KT-48160 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
445e5122c1
commit
3ec9599bc4
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
//KT-48160
|
||||
// FIR_IDENTICAL
|
||||
// FULL_JDK
|
||||
// WITH_STDLIB
|
||||
|
||||
import java.io.File
|
||||
|
||||
inline fun <T : AutoCloseable, R> T.use(block: (T) -> R): R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
fun foo(): Int? {
|
||||
try {
|
||||
File("123").bufferedWriter().use {
|
||||
return 45
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
if (e.message?.startsWith("Remote does not have ") == true) {
|
||||
return null
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Int?
|
||||
public inline fun </*0*/ T : java.lang.AutoCloseable, /*1*/ R> T.use(/*0*/ block: (T) -> R): R
|
||||
Reference in New Issue
Block a user