KT-1041 Add check that thrown/catched expression is of Throwable type

This commit is contained in:
Svetlana Isakova
2012-02-20 13:46:34 +04:00
parent 3d3b41da4f
commit 046c13a264
12 changed files with 47 additions and 13 deletions
@@ -109,7 +109,7 @@ fun t7() : Int {
return 1
<!UNREACHABLE_CODE!>2<!>
}
catch (e : Any) {
catch (<!TYPE_MISMATCH!>e : Any<!>) {
<!UNUSED_EXPRESSION!>2<!>
}
return 1 // this is OK, like in Java
@@ -120,7 +120,7 @@ fun t8() : Int {
return 1
<!UNREACHABLE_CODE!>2<!>
}
catch (e : Any) {
catch (<!TYPE_MISMATCH!>e : Any<!>) {
return 1
<!UNREACHABLE_CODE!>2<!>
}