Correctly indent upper bound separator in the generated stdlib code

This commit is contained in:
Ilya Gorbunov
2018-04-20 23:10:47 +03:00
parent 5381d0ed58
commit c239d346f7
15 changed files with 48 additions and 48 deletions
@@ -6139,7 +6139,7 @@ public expect fun CharArray.sort(): Unit
/**
* Sorts the array in-place according to the natural order of its elements.
*/
public expect fun <T: Comparable<T>> Array<out T>.sort(): Unit
public expect fun <T : Comparable<T>> Array<out T>.sort(): Unit
/**
* Sorts the array in-place according to the order specified by the given [comparator].
@@ -11304,7 +11304,7 @@ public inline fun CharArray.none(predicate: (Char) -> Boolean): Boolean {
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element.
*/
public inline fun <S, T: S> Array<out T>.reduce(operation: (acc: S, T) -> S): S {
public inline fun <S, T : S> Array<out T>.reduce(operation: (acc: S, T) -> S): S {
if (isEmpty())
throw UnsupportedOperationException("Empty array can't be reduced.")
var accumulator: S = this[0]
@@ -11424,7 +11424,7 @@ public inline fun CharArray.reduce(operation: (acc: Char, Char) -> Char): Char {
* @param [operation] function that takes the index of an element, current accumulator value
* and the element itself and calculates the next accumulator value.
*/
public inline fun <S, T: S> Array<out T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {
public inline fun <S, T : S> Array<out T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {
if (isEmpty())
throw UnsupportedOperationException("Empty array can't be reduced.")
var accumulator: S = this[0]
@@ -11565,7 +11565,7 @@ public inline fun CharArray.reduceIndexed(operation: (index: Int, acc: Char, Cha
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value.
*/
public inline fun <S, T: S> Array<out T>.reduceRight(operation: (T, acc: S) -> S): S {
public inline fun <S, T : S> Array<out T>.reduceRight(operation: (T, acc: S) -> S): S {
var index = lastIndex
if (index < 0) throw UnsupportedOperationException("Empty array can't be reduced.")
var accumulator: S = get(index--)
@@ -11685,7 +11685,7 @@ public inline fun CharArray.reduceRight(operation: (Char, acc: Char) -> Char): C
* @param [operation] function that takes the index of an element, the element itself
* and current accumulator value, and calculates the next accumulator value.
*/
public inline fun <S, T: S> Array<out T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {
public inline fun <S, T : S> Array<out T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {
var index = lastIndex
if (index < 0) throw UnsupportedOperationException("Empty array can't be reduced.")
var accumulator: S = get(index--)
@@ -1698,7 +1698,7 @@ public inline fun <T, C : Iterable<T>> C.onEach(action: (T) -> Unit): C {
/**
* Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element.
*/
public inline fun <S, T: S> Iterable<T>.reduce(operation: (acc: S, T) -> S): S {
public inline fun <S, T : S> Iterable<T>.reduce(operation: (acc: S, T) -> S): S {
val iterator = this.iterator()
if (!iterator.hasNext()) throw UnsupportedOperationException("Empty collection can't be reduced.")
var accumulator: S = iterator.next()
@@ -1714,7 +1714,7 @@ public inline fun <S, T: S> Iterable<T>.reduce(operation: (acc: S, T) -> S): S {
* @param [operation] function that takes the index of an element, current accumulator value
* and the element itself and calculates the next accumulator value.
*/
public inline fun <S, T: S> Iterable<T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {
public inline fun <S, T : S> Iterable<T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {
val iterator = this.iterator()
if (!iterator.hasNext()) throw UnsupportedOperationException("Empty collection can't be reduced.")
var index = 1
@@ -1728,7 +1728,7 @@ public inline fun <S, T: S> Iterable<T>.reduceIndexed(operation: (index: Int, ac
/**
* Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value.
*/
public inline fun <S, T: S> List<T>.reduceRight(operation: (T, acc: S) -> S): S {
public inline fun <S, T : S> List<T>.reduceRight(operation: (T, acc: S) -> S): S {
val iterator = listIterator(size)
if (!iterator.hasPrevious())
throw UnsupportedOperationException("Empty list can't be reduced.")
@@ -1745,7 +1745,7 @@ public inline fun <S, T: S> List<T>.reduceRight(operation: (T, acc: S) -> S): S
* @param [operation] function that takes the index of an element, the element itself
* and current accumulator value, and calculates the next accumulator value.
*/
public inline fun <S, T: S> List<T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {
public inline fun <S, T : S> List<T>.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {
val iterator = listIterator(size)
if (!iterator.hasPrevious())
throw UnsupportedOperationException("Empty list can't be reduced.")
@@ -17,7 +17,7 @@ import kotlin.comparisons.*
* If values are equal, returns the first one.
*/
@SinceKotlin("1.1")
public expect fun <T: Comparable<T>> maxOf(a: T, b: T): T
public expect fun <T : Comparable<T>> maxOf(a: T, b: T): T
/**
* Returns the greater of two values.
@@ -65,7 +65,7 @@ public expect inline fun maxOf(a: Double, b: Double): Double
* Returns the greater of three values.
*/
@SinceKotlin("1.1")
public expect fun <T: Comparable<T>> maxOf(a: T, b: T, c: T): T
public expect fun <T : Comparable<T>> maxOf(a: T, b: T, c: T): T
/**
* Returns the greater of three values.
@@ -131,7 +131,7 @@ public fun <T> maxOf(a: T, b: T, comparator: Comparator<in T>): T {
* If values are equal, returns the first one.
*/
@SinceKotlin("1.1")
public expect fun <T: Comparable<T>> minOf(a: T, b: T): T
public expect fun <T : Comparable<T>> minOf(a: T, b: T): T
/**
* Returns the smaller of two values.
@@ -179,7 +179,7 @@ public expect inline fun minOf(a: Double, b: Double): Double
* Returns the smaller of three values.
*/
@SinceKotlin("1.1")
public expect fun <T: Comparable<T>> minOf(a: T, b: T, c: T): T
public expect fun <T : Comparable<T>> minOf(a: T, b: T, c: T): T
/**
* Returns the smaller of three values.
@@ -707,7 +707,7 @@ public infix fun Short.until(to: Short): IntRange {
*
* @sample samples.comparisons.ComparableOps.coerceAtLeastComparable
*/
public fun <T: Comparable<T>> T.coerceAtLeast(minimumValue: T): T {
public fun <T : Comparable<T>> T.coerceAtLeast(minimumValue: T): T {
return if (this < minimumValue) minimumValue else this
}
@@ -784,7 +784,7 @@ public fun Double.coerceAtLeast(minimumValue: Double): Double {
*
* @sample samples.comparisons.ComparableOps.coerceAtMostComparable
*/
public fun <T: Comparable<T>> T.coerceAtMost(maximumValue: T): T {
public fun <T : Comparable<T>> T.coerceAtMost(maximumValue: T): T {
return if (this > maximumValue) maximumValue else this
}
@@ -861,7 +861,7 @@ public fun Double.coerceAtMost(maximumValue: Double): Double {
*
* @sample samples.comparisons.ComparableOps.coerceInComparable
*/
public fun <T: Comparable<T>> T.coerceIn(minimumValue: T?, maximumValue: T?): T {
public fun <T : Comparable<T>> T.coerceIn(minimumValue: T?, maximumValue: T?): T {
if (minimumValue !== null && maximumValue !== null) {
if (minimumValue > maximumValue) throw IllegalArgumentException("Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.")
if (this < minimumValue) return minimumValue
@@ -966,7 +966,7 @@ public fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double {
* @sample samples.comparisons.ComparableOps.coerceInFloatingPointRange
*/
@SinceKotlin("1.1")
public fun <T: Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T {
public fun <T : Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T {
if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.")
return when {
// this < start equiv to this <= start && !(this >= start)
@@ -984,7 +984,7 @@ public fun <T: Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T
*
* @sample samples.comparisons.ComparableOps.coerceInComparable
*/
public fun <T: Comparable<T>> T.coerceIn(range: ClosedRange<T>): T {
public fun <T : Comparable<T>> T.coerceIn(range: ClosedRange<T>): T {
if (range is ClosedFloatingPointRange) {
return this.coerceIn<T>(range)
}
@@ -1264,7 +1264,7 @@ public fun <T> Sequence<T>.onEach(action: (T) -> Unit): Sequence<T> {
*
* The operation is _terminal_.
*/
public inline fun <S, T: S> Sequence<T>.reduce(operation: (acc: S, T) -> S): S {
public inline fun <S, T : S> Sequence<T>.reduce(operation: (acc: S, T) -> S): S {
val iterator = this.iterator()
if (!iterator.hasNext()) throw UnsupportedOperationException("Empty sequence can't be reduced.")
var accumulator: S = iterator.next()
@@ -1282,7 +1282,7 @@ public inline fun <S, T: S> Sequence<T>.reduce(operation: (acc: S, T) -> S): S {
*
* The operation is _terminal_.
*/
public inline fun <S, T: S> Sequence<T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {
public inline fun <S, T : S> Sequence<T>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {
val iterator = this.iterator()
if (!iterator.hasNext()) throw UnsupportedOperationException("Empty sequence can't be reduced.")
var index = 1