Replace 'class object' with 'default object' in builtins
This commit is contained in:
@@ -22,7 +22,7 @@ package kotlin
|
||||
* information on enum classes.
|
||||
*/
|
||||
public abstract class Enum<E : Enum<E>>(name: String, ordinal: Int): Comparable<E> {
|
||||
class object {}
|
||||
default object {}
|
||||
|
||||
/**
|
||||
* Returns the name of this enum constant, exactly as declared in its enum declaration.
|
||||
|
||||
@@ -23,7 +23,7 @@ package kotlin
|
||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`.
|
||||
*/
|
||||
public class Byte private () : Number, Comparable<Byte> {
|
||||
class object {}
|
||||
default object {}
|
||||
|
||||
public override fun compareTo(other: Byte): Int
|
||||
public fun compareTo(other: Char): Int
|
||||
@@ -100,7 +100,7 @@ public class Byte private () : Number, Comparable<Byte> {
|
||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `short`.
|
||||
*/
|
||||
public class Short private () : Number, Comparable<Short> {
|
||||
class object {}
|
||||
default object {}
|
||||
|
||||
public fun compareTo(other: Byte): Int
|
||||
public fun compareTo(other: Char): Int
|
||||
@@ -177,7 +177,7 @@ public class Short private () : Number, Comparable<Short> {
|
||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `int`.
|
||||
*/
|
||||
public class Int private () : Number, Comparable<Int> {
|
||||
class object {}
|
||||
default object {}
|
||||
|
||||
public fun compareTo(other: Byte): Int
|
||||
public fun compareTo(other: Char): Int
|
||||
@@ -262,7 +262,7 @@ public class Int private () : Number, Comparable<Int> {
|
||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `long`.
|
||||
*/
|
||||
public class Long private () : Number, Comparable<Long> {
|
||||
class object {}
|
||||
default object {}
|
||||
|
||||
public fun compareTo(other: Byte): Int
|
||||
public fun compareTo(other: Char): Int
|
||||
@@ -347,7 +347,7 @@ public class Long private () : Number, Comparable<Long> {
|
||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `float`.
|
||||
*/
|
||||
public class Float private () : Number, Comparable<Float> {
|
||||
class object : FloatingPointConstants<Float> {}
|
||||
default object : FloatingPointConstants<Float> {}
|
||||
|
||||
public fun compareTo(other: Byte): Int
|
||||
public fun compareTo(other: Char): Int
|
||||
@@ -424,7 +424,7 @@ public class Float private () : Number, Comparable<Float> {
|
||||
* On the JVM, non-nullable values of this type are represented as values of the primitive type `double`.
|
||||
*/
|
||||
public class Double private () : Number, Comparable<Double> {
|
||||
class object : FloatingPointConstants<Double> {}
|
||||
default object : FloatingPointConstants<Double> {}
|
||||
|
||||
public fun compareTo(other: Byte): Int
|
||||
public fun compareTo(other: Char): Int
|
||||
|
||||
@@ -21,7 +21,7 @@ package kotlin
|
||||
* implemented as instances of this class.
|
||||
*/
|
||||
public class String : Comparable<String>, CharSequence {
|
||||
class object {}
|
||||
default object {}
|
||||
|
||||
/**
|
||||
* Returns a string obtained by concatenating this string with the string representation of the given [other] object.
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ByteRange(override val start: Byte, override val end: Byte) : Range
|
||||
override fun hashCode(): Int =
|
||||
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Byte. */
|
||||
public val EMPTY: ByteRange = ByteRange(1, 0)
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class CharRange(override val start: Char, override val end: Char) : Range
|
||||
override fun hashCode(): Int =
|
||||
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Char. */
|
||||
public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar())
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class ShortRange(override val start: Short, override val end: Short) : Ra
|
||||
override fun hashCode(): Int =
|
||||
if (isEmpty()) -1 else (31 * start.toInt() + end)
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Short. */
|
||||
public val EMPTY: ShortRange = ShortRange(1, 0)
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class IntRange(override val start: Int, override val end: Int) : Range<In
|
||||
override fun hashCode(): Int =
|
||||
if (isEmpty()) -1 else (31 * start + end)
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Int. */
|
||||
public val EMPTY: IntRange = IntRange(1, 0)
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class LongRange(override val start: Long, override val end: Long) : Range
|
||||
override fun hashCode(): Int =
|
||||
if (isEmpty()) -1 else (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))).toInt()
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Long. */
|
||||
public val EMPTY: LongRange = LongRange(1, 0)
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class FloatRange(override val start: Float, override val end: Float) : Ra
|
||||
override fun hashCode(): Int =
|
||||
if (isEmpty()) -1 else (31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end))
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Float. */
|
||||
public val EMPTY: FloatRange = FloatRange(1.0f, 0.0f)
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class DoubleRange(override val start: Double, override val end: Double) :
|
||||
return (31 * result + (temp xor (temp ushr 32))).toInt()
|
||||
}
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type Double. */
|
||||
public val EMPTY: DoubleRange = DoubleRange(1.0, 0.0)
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class GenerateNumbers(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
generateDoc(kind)
|
||||
out.println("public class $className private () : Number, Comparable<$className> {")
|
||||
|
||||
out.print(" class object")
|
||||
out.print(" default object")
|
||||
if (kind == PrimitiveType.FLOAT || kind == PrimitiveType.DOUBLE) {
|
||||
out.print(" : FloatingPointConstants<$className>")
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class $range(override val start: $t, override val end: $t) : Range<$t>, P
|
||||
|
||||
override fun hashCode(): Int $hashCode
|
||||
|
||||
class object {
|
||||
default object {
|
||||
/** An empty range of values of type $t. */
|
||||
public val EMPTY: $range = $range($emptyBounds)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user