KT-1041 Add check that thrown/catched expression is of Throwable type
This commit is contained in:
@@ -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<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user