KT-58 Allow finally around definite returns

This commit is contained in:
svtk
2011-11-08 16:25:04 +04:00
parent f47f462dca
commit dfb17a5f0e
10 changed files with 654 additions and 228 deletions
+58
View File
@@ -130,4 +130,62 @@ fun t11() {
finally {
return 2
}
}
fun t12() : Int {
try {
return 1
}
finally {
doSmth(3)
}
}
fun t13() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
finally {
doSmth(3)
}
}
fun t14() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
}
fun t15() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
fun t16() : Int {
try {
doSmth(1)
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
fun doSmth(i: Int) {
}