KT-53465, KT-53677 Get rid of unnecessary checkcasts to array of reified type
This commit is contained in:
committed by
teamcity
parent
d8522a8967
commit
a75d5ba4cf
+6
-1
@@ -2,8 +2,13 @@ abstract class Base {
|
||||
private fun test(): String = "OK"
|
||||
|
||||
fun test(d: Derived): String = (d as Base).test()
|
||||
|
||||
fun test(d: Array<out Derived>) = (d as Array<out Base>)[0].test()
|
||||
}
|
||||
|
||||
class Derived : Base()
|
||||
|
||||
fun box(): String = Derived().test(Derived())
|
||||
fun box(): String {
|
||||
Derived().test(arrayOf(Derived()))
|
||||
return Derived().test(Derived())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user