FIR: introduce parameter type is Throwable check

This commit is contained in:
eugenpolytechnic
2021-01-31 17:37:11 +03:00
committed by Mikhail Glukhikh
parent 5c0231b727
commit 9ad88a5a0d
5 changed files with 67 additions and 16 deletions
@@ -1,4 +1,6 @@
fun <T> test() {
typealias StringType = String
fun <T : Throwable> test() {
try {
} catch (<!CATCH_PARAMETER_WITH_DEFAULT_VALUE!>e: NullPointerException = NullPointerException()<!>) {
@@ -6,8 +8,16 @@ fun <T> test() {
}
try {} catch (<!TYPE_PARAMETER_IN_CATCH_CLAUSE!>e: T<!>) {}
try {} catch (<!TYPE_MISMATCH!>e: () -> Int<!>) {}
try {} catch (<!TYPE_MISMATCH!>e: StringType<!>) {}
try {} catch (<!CATCH_PARAMETER_WITH_DEFAULT_VALUE, TYPE_MISMATCH!>e: Int = 5<!>) {}
try {} catch (e: Throwable) {}
}
inline fun <reified T> anotherTest() {
try {} catch (<!REIFIED_TYPE_IN_CATCH_CLAUSE!>e: T<!>) {}
}
try {} catch (<!REIFIED_TYPE_IN_CATCH_CLAUSE, TYPE_MISMATCH!>e: T<!>) {}
}