backend/tests: add runtime/memory/throw_cleanup.kt

This commit is contained in:
Svyatoslav Scherbina
2016-12-29 12:54:56 +07:00
committed by SvyatoslavScherbina
parent 4cfe569001
commit 5d8a28e5fc
2 changed files with 21 additions and 0 deletions
@@ -0,0 +1,16 @@
fun main(args: Array<String>) {
foo(false)
try {
foo(true)
} catch (e: Error) {
println("Ok")
}
}
fun foo(b: Boolean): Any {
var result = Any()
if (b) {
throw Error()
}
return result
}