Files
kotlin-fork/compiler/testData/cfg/FinallyTestCopy.jet
T
Svetlana Isakova d778952512 fixed bug with incorrect copy of pseudocode part
(was noticeable in doTestCopy4 example)
labels after part should be repeated as well
2012-12-18 16:00:27 +04:00

58 lines
854 B
Plaintext

fun testCopy1() : Int {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
return 1
}
}
fun testCopy2() {
while (cond()) {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
if (cond()) return
else continue
}
}
}
fun testCopy3() {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
while (cond());
}
}
fun doTestCopy4() : Int {
try {
doSmth()
}
finally {
if(list != null) {
}
}
}