diff --git a/libraries/stdlib/src/generated/_SpecialJVM.kt b/libraries/stdlib/src/generated/_SpecialJVM.kt index 135cb18ece9..543377cefbe 100644 --- a/libraries/stdlib/src/generated/_SpecialJVM.kt +++ b/libraries/stdlib/src/generated/_SpecialJVM.kt @@ -409,64 +409,64 @@ public fun Array.copyOfRange(from: Int, to: Int): Array { /** * Fills original array with the provided value. */ -public fun BooleanArray.fill(element: Boolean): Unit { - Arrays.fill(this, element) +public fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun ByteArray.fill(element: Byte): Unit { - Arrays.fill(this, element) +public fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun CharArray.fill(element: Char): Unit { - Arrays.fill(this, element) +public fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun DoubleArray.fill(element: Double): Unit { - Arrays.fill(this, element) +public fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun FloatArray.fill(element: Float): Unit { - Arrays.fill(this, element) +public fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun IntArray.fill(element: Int): Unit { - Arrays.fill(this, element) +public fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun LongArray.fill(element: Long): Unit { - Arrays.fill(this, element) +public fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun ShortArray.fill(element: Short): Unit { - Arrays.fill(this, element) +public fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** * Fills original array with the provided value. */ -public fun Array.fill(element: T): Unit { - Arrays.fill(this, element) +public fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int = size()): Unit { + Arrays.fill(this, fromIndex, toIndex, element) } /** diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt index c8bb90feff2..0dffc7db4bd 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt @@ -83,13 +83,13 @@ fun specialJVM(): List { annotations(InvariantArraysOfObjects) { """platformName("mutableCopyOf")"""} } - templates add f("fill(element: T)") { + templates add f("fill(element: T, fromIndex: Int = 0, toIndex: Int = size())") { only(InvariantArraysOfObjects, ArraysOfPrimitives) doc { "Fills original array with the provided value." } returns { "Unit" } body { """ - Arrays.fill(this, element) + Arrays.fill(this, fromIndex, toIndex, element) """ } }