KT-53465, KT-53677 Get rid of unnecessary checkcasts to array of reified type

This commit is contained in:
Pavel Mikhailovskii
2022-09-06 11:12:42 +02:00
committed by teamcity
parent d8522a8967
commit a75d5ba4cf
17 changed files with 213 additions and 1 deletions
@@ -0,0 +1,10 @@
// TARGET_BACKEND: JVM
inline fun <reified T : CharSequence> f(x: Array<Any>) = x as Array<T>
fun box(): String = try {
f<String>(arrayOf<Any>(42))
"Fail"
} catch (e: Exception) {
"OK"
}