Get rid of 'class object' usages in code and builtins
Replace some comments and library usages as well
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 Companion {}
|
||||
companion 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 Companion {}
|
||||
companion object {}
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
@@ -181,7 +181,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 `char`.
|
||||
*/
|
||||
public class Char private () : Comparable<Char> {
|
||||
class object Companion {}
|
||||
companion object {}
|
||||
|
||||
/**
|
||||
* Compares the character code of this character with the specified value for order.
|
||||
@@ -326,7 +326,7 @@ public class Char private () : Comparable<Char> {
|
||||
* 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 Companion {}
|
||||
companion object {}
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
@@ -484,7 +484,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 Companion {}
|
||||
companion object {}
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
@@ -657,7 +657,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 Companion {}
|
||||
companion object {}
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
@@ -830,7 +830,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 Companion : FloatingPointConstants<Float> {}
|
||||
companion object : FloatingPointConstants<Float> {}
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
@@ -988,7 +988,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 Companion : FloatingPointConstants<Double> {}
|
||||
companion object : FloatingPointConstants<Double> {}
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
|
||||
@@ -21,7 +21,7 @@ package kotlin
|
||||
* implemented as instances of this class.
|
||||
*/
|
||||
public class String : Comparable<String>, CharSequence {
|
||||
class object Companion {}
|
||||
companion 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 Companion {
|
||||
companion 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 Companion {
|
||||
companion 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 Companion {
|
||||
companion 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 Companion {
|
||||
companion 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 Companion {
|
||||
companion 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 Companion {
|
||||
companion 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 Companion {
|
||||
companion object {
|
||||
/** An empty range of values of type Double. */
|
||||
public val EMPTY: DoubleRange = DoubleRange(1.0, 0.0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user