FIR: introduce CatchParameterChecker

This commit is contained in:
eugenpolytechnic
2021-01-29 23:57:19 +03:00
committed by Mikhail Glukhikh
parent d8549d6292
commit 5c0231b727
16 changed files with 123 additions and 10 deletions
@@ -17,10 +17,10 @@ fun bar() {
inline fun <reified E : Exception, R> tryCatch(lazy: () -> R, failure: (E) -> R): R =
try {
lazy()
} catch (e: E) {
} catch (<!REIFIED_TYPE_IN_CATCH_CLAUSE!>e: E<!>) {
failure(e)
}
fun <T : Throwable> tryCatch() {
try { } catch (e: T) { }
}
try { } catch (<!TYPE_PARAMETER_IN_CATCH_CLAUSE!>e: T<!>) { }
}
@@ -1,3 +1,3 @@
fun test() {
try { } catch (e: Exception = Exception()) { }
}
try { } catch (<!CATCH_PARAMETER_WITH_DEFAULT_VALUE!>e: Exception = Exception()<!>) { }
}