[Generator] Set up body for rangeTo and rangeUntil by default

Also use expression body formatting for `rangeTo`.
This commit is contained in:
Ilya Gorbunov
2023-04-22 05:13:45 +02:00
committed by Space Team
parent 097535aeea
commit 3f3cd2e87a
8 changed files with 86 additions and 126 deletions
@@ -299,24 +299,20 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
-this.toInt()
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Byte): IntRange {
return IntRange(this.toInt(), other.toInt())
}
public operator fun rangeTo(other: Byte): IntRange =
IntRange(this.toInt(), other.toInt())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Short): IntRange {
return IntRange(this.toInt(), other.toInt())
}
public operator fun rangeTo(other: Short): IntRange =
IntRange(this.toInt(), other.toInt())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Int): IntRange {
return IntRange(this.toInt(), other)
}
public operator fun rangeTo(other: Int): IntRange =
IntRange(this.toInt(), other)
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Long): LongRange {
return LongRange(this.toLong(), other)
}
public operator fun rangeTo(other: Long): LongRange =
LongRange(this.toLong(), other)
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -725,24 +721,20 @@ public class Short private constructor(private val value: Short) : Number(), Com
-this.toInt()
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Byte): IntRange {
return IntRange(this.toInt(), other.toInt())
}
public operator fun rangeTo(other: Byte): IntRange =
IntRange(this.toInt(), other.toInt())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Short): IntRange {
return IntRange(this.toInt(), other.toInt())
}
public operator fun rangeTo(other: Short): IntRange =
IntRange(this.toInt(), other.toInt())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Int): IntRange {
return IntRange(this.toInt(), other)
}
public operator fun rangeTo(other: Int): IntRange =
IntRange(this.toInt(), other)
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Long): LongRange {
return LongRange(this.toLong(), other)
}
public operator fun rangeTo(other: Long): LongRange =
LongRange(this.toLong(), other)
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1154,24 +1146,20 @@ public class Int private constructor(private val value: Int) : Number(), Compara
0 - this
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Byte): IntRange {
return IntRange(this, other.toInt())
}
public operator fun rangeTo(other: Byte): IntRange =
IntRange(this, other.toInt())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Short): IntRange {
return IntRange(this, other.toInt())
}
public operator fun rangeTo(other: Short): IntRange =
IntRange(this, other.toInt())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Int): IntRange {
return IntRange(this, other)
}
public operator fun rangeTo(other: Int): IntRange =
IntRange(this, other)
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Long): LongRange {
return LongRange(this.toLong(), other)
}
public operator fun rangeTo(other: Long): LongRange =
LongRange(this.toLong(), other)
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1656,24 +1644,20 @@ public class Long private constructor(private val value: Long) : Number(), Compa
0L - this
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Byte): LongRange {
return LongRange(this, other.toLong())
}
public operator fun rangeTo(other: Byte): LongRange =
LongRange(this, other.toLong())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Short): LongRange {
return LongRange(this, other.toLong())
}
public operator fun rangeTo(other: Short): LongRange =
LongRange(this, other.toLong())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Int): LongRange {
return LongRange(this, other.toLong())
}
public operator fun rangeTo(other: Int): LongRange =
LongRange(this, other.toLong())
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Long): LongRange {
return LongRange(this, other)
}
public operator fun rangeTo(other: Long): LongRange =
LongRange(this, other)
/**
* Creates a range from this value up to but excluding the specified [other] value.