Array<Subtype> can be now cast to Array<Supertype(?)> without CAST_NEVER_SUCCEEDS #KT-6391 Fixed
(cherry picked from commit 2629d55)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
90e5e561e3
commit
dbbc4ec281
@@ -23,5 +23,12 @@ fun checkArrays2(): Array<Wrapper<String>> {
|
||||
return <!UNCHECKED_CAST!>someArray as Array<Wrapper<String>><!>
|
||||
}
|
||||
|
||||
fun checkArrays3() {
|
||||
val someArray = arrayOfNulls<String>(1)
|
||||
<!UNCHECKED_CAST!>someArray as Array<Any><!>
|
||||
val intArray = arrayOfNulls<Int>(1)
|
||||
<!UNCHECKED_CAST!>intArray as Array<Any><!>
|
||||
}
|
||||
|
||||
fun println(s: String) = s
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package
|
||||
|
||||
public fun checkArrays(): kotlin.Array<kotlin.Any>
|
||||
public fun checkArrays2(): kotlin.Array<Wrapper<kotlin.String>>
|
||||
public fun checkArrays3(): kotlin.Unit
|
||||
public fun println(/*0*/ s: kotlin.String): kotlin.String
|
||||
public fun </*0*/ T> test(/*0*/ clazz: Class<T>): kotlin.Unit
|
||||
public fun use(): kotlin.Unit
|
||||
|
||||
Reference in New Issue
Block a user