[FIR] Properly create edges from return expression to finally block

^KT-48376 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-08-25 11:00:56 +03:00
parent 16b7735cd6
commit 3176dd1341
8 changed files with 211 additions and 4 deletions
@@ -0,0 +1,18 @@
FILE: variableInitializedInTryBlock.kt
public final fun test(): R|kotlin/Unit| {
lval b: R|kotlin/Boolean|
try {
lval s: R|kotlin/String| = R|/getStringOrNull|() ?: ^test Unit
R|<local>/b| = !=(R|<local>/s|.R|kotlin/String.length|, Int(0))
}
finally {
R|/test|()
}
R|/takeBoolean|(R|<local>/b|)
}
public final fun takeBoolean(b: R|kotlin/Boolean|): R|kotlin/Unit| {
}
public final fun getStringOrNull(): R|kotlin/String?| {
^getStringOrNull String(hello)
}