KT-9644: override default behavior for non-local return in FixStackAnalyzer
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
inline fun doCall(f: () -> Any) = f()
|
||||
|
||||
fun test1() {
|
||||
val localResult = doCall {
|
||||
try { "1" } catch (e: Exception) { "2" }
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
fun test2(): String {
|
||||
val localResult = doCall {
|
||||
try { "1" } catch (e: Exception) { "2" }
|
||||
return@test2 "OK"
|
||||
}
|
||||
return "Hmmm..."
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test1()
|
||||
return test2()
|
||||
}
|
||||
Reference in New Issue
Block a user