backend/tests: add runtime/memory/throw_cleanup.kt
This commit is contained in:
committed by
SvyatoslavScherbina
parent
4cfe569001
commit
5d8a28e5fc
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user