Fix bug in try/catch resolution in NI

Bug was presented in a236ad5
This commit is contained in:
Dmitriy Novozhilov
2019-02-18 12:38:36 +03:00
parent 1e4b7e1ef1
commit 5d0074bda5
5 changed files with 44 additions and 2 deletions
@@ -0,0 +1,25 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// !LANGUAGE: +NewInference
val stack = mutableListOf<Int>()
fun <E> MutableList<E>.pop() = this.removeAt(size - 1)
fun foo() {}
fun getBoolean(): Boolean = true
fun box(): String {
val b = getBoolean()
if (b) {
stack.add(1)
try {
return "OK"
} finally {
stack.pop()
}
} else {
return "OK"
}
}