backend: add tests for try-catch-finally and throwing exceptions
also add some tests for bugs with unreachable code handling and variables
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
fun main(args : Array<String>) {
|
||||
do {
|
||||
try {
|
||||
break
|
||||
} finally {
|
||||
println("Finally 1")
|
||||
}
|
||||
} while (false)
|
||||
|
||||
var stop = false
|
||||
while (!stop) {
|
||||
try {
|
||||
stop = true
|
||||
continue
|
||||
} finally {
|
||||
println("Finally 2")
|
||||
}
|
||||
}
|
||||
|
||||
println("After")
|
||||
}
|
||||
Reference in New Issue
Block a user