提交 a7bad9a9 编写于 作者: N Nikolay Igotti 提交者: GitHub

Fix several tests by adding missing stdlib pieces. (#239)

上级 061a8a0b
......@@ -16,6 +16,10 @@ For an optimized compilation use -opt:
./dist/bin/konanc hello.kt -o hello -opt
For more tests, use:
For some tests, use:
./gradlew backend.native:tests:run
To run blackbox compiler tests from JVM Kotlin use (takes time):
./gradlew run_external
\ No newline at end of file
......@@ -491,17 +491,6 @@ public inline fun <T> Array<out T>.lastOrNull(predicate: (T) -> Boolean): T? {
return null
}
/**
* Returns the range of valid indices for the array.
*/
public val <T> Array<out T>.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the last valid index for the array.
*/
public val <T> Array<out T>.lastIndex: Int
get() = size - 1
/**
* Applies the given [transform] function to each element of the original array
......@@ -589,6 +578,61 @@ public fun Array<out Double>.sum(): Double {
// From _Arrays.kt.
/**
* Returns the range of valid indices for the array.
*/
public val <T> Array<out T>.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val ByteArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val ShortArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val IntArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val LongArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val FloatArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val DoubleArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val BooleanArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array.
*/
public val CharArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns `true` if the array is empty.
*/
......@@ -732,6 +776,61 @@ public inline fun CharArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns the last valid index for the array.
*/
public val <T> Array<out T>.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val ByteArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val ShortArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val IntArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val LongArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val FloatArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val DoubleArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val BooleanArray.lastIndex: Int
get() = size - 1
/**
* Returns the last valid index for the array.
*/
public val CharArray.lastIndex: Int
get() = size - 1
/**
* Appends all elements to the given [destination] collection.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册