Frontend part of KT-910 Type of try/catch/finally

This commit is contained in:
Svetlana Isakova
2012-05-18 15:20:37 +04:00
parent b49fa2ab82
commit 2d601cf4a2
3 changed files with 33 additions and 8 deletions
@@ -0,0 +1,27 @@
package a
fun foo() : Int {
try {
doSmth()
}
catch (e: Exception) {
<!UNREACHABLE_CODE!>return <!TYPE_MISMATCH!>""<!><!>
}
finally {
return <!TYPE_MISMATCH!>""<!>
}
}
fun bar() : Int =
try {
<!TYPE_MISMATCH!>doSmth()<!>
}
catch (e: Exception) {
<!TYPE_MISMATCH!>""<!>
}
finally {
<!UNUSED_EXPRESSION!>""<!>
}
fun doSmth() {}