Refactored tests using Array constructor:
Some moved to tests with stdlib Some changed to use arrayOfNulls
This commit is contained in:
committed by
Alexander Udalov
parent
abbcf61183
commit
654411a0b0
@@ -0,0 +1,12 @@
|
||||
package b
|
||||
|
||||
fun bar() {
|
||||
val a1 = Array(1, {(i: Int) -> i})
|
||||
val a2 = Array(1, {(i: Int) -> "$i"})
|
||||
val a3 = Array(1, {it})
|
||||
|
||||
a1 : Array<Int>
|
||||
a2 : Array<String>
|
||||
a3 : Array<Int>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
package b {
|
||||
internal fun bar(): kotlin.Unit
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//KT-1558 Exception while analyzing
|
||||
package j
|
||||
|
||||
fun <T : Any> T?.sure() : T = this!!
|
||||
|
||||
fun <E> List<*>.toArray(ar: Array<E>): Array<E> = ar
|
||||
|
||||
fun testArrays(ci: List<Int?>, cii: List<Int?>?) {
|
||||
val c1: Array<Int?> = cii.sure().toArray(<!FUNCTION_CALL_EXPECTED!><!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>Array<!><Int?><!>)
|
||||
|
||||
val c2: Array<Int?> = ci.toArray(Array<Int?>(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>)
|
||||
|
||||
val c3 = Array<Int?>(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
|
||||
val c4 = ci.toArray<Int?>(Array<Int?>(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>)
|
||||
|
||||
val c5 = ci.toArray(Array<Int?>(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>)
|
||||
|
||||
c1 : Array<Int?>
|
||||
c2 : Array<Int?>
|
||||
c3 : Array<Int?>
|
||||
c4 : Array<Int?>
|
||||
c5 : Array<Int?>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package
|
||||
|
||||
package j {
|
||||
internal fun testArrays(/*0*/ ci: kotlin.List<kotlin.Int?>, /*1*/ cii: kotlin.List<kotlin.Int?>?): kotlin.Unit
|
||||
internal fun </*0*/ T : kotlin.Any> T?.sure(): T
|
||||
internal fun </*0*/ E> kotlin.List<kotlin.Any?>.toArray(/*0*/ ar: kotlin.Array<E>): kotlin.Array<E>
|
||||
}
|
||||
Reference in New Issue
Block a user