Primitive Companion objects do not longer implement IntegerConstants and FloatingPointConstants. All declarations moved inside companions.

IntegerConstants and FloatingPointConstants are dropped.
#KT-8897 Fixed
This commit is contained in:
Ilya Gorbunov
2015-12-24 06:17:03 +03:00
parent fc4250b02b
commit de11ed4fc6
14 changed files with 355 additions and 228 deletions
+42 -62
View File
@@ -121,12 +121,12 @@ public final class Byte : kotlin.Number, kotlin.Comparable<kotlin.Byte> {
public final operator fun unaryMinus(): kotlin.Int
public final operator fun unaryPlus(): kotlin.Int
public companion object Companion : kotlin.IntegerConstants<kotlin.Byte> {
public companion object Companion {
/*primary*/ private constructor Companion()
public abstract override /*1*/ /*fake_override*/ val MAX_VALUE: kotlin.Byte
public abstract override /*1*/ /*fake_override*/ fun <get-MAX_VALUE>(): kotlin.Byte
public abstract override /*1*/ /*fake_override*/ val MIN_VALUE: kotlin.Byte
public abstract override /*1*/ /*fake_override*/ fun <get-MIN_VALUE>(): kotlin.Byte
public const final val MAX_VALUE: kotlin.Byte
public final fun <get-MAX_VALUE>(): kotlin.Byte
public const final val MIN_VALUE: kotlin.Byte
public final fun <get-MIN_VALUE>(): kotlin.Byte
}
}
@@ -437,18 +437,18 @@ public final class Double : kotlin.Number, kotlin.Comparable<kotlin.Double> {
public final operator fun unaryMinus(): kotlin.Double
public final operator fun unaryPlus(): kotlin.Double
public companion object Companion : kotlin.FloatingPointConstants<kotlin.Double> {
public companion object Companion {
/*primary*/ private constructor Companion()
public abstract override /*1*/ /*fake_override*/ val MAX_VALUE: kotlin.Double
public abstract override /*1*/ /*fake_override*/ fun <get-MAX_VALUE>(): kotlin.Double
public abstract override /*1*/ /*fake_override*/ val MIN_VALUE: kotlin.Double
public abstract override /*1*/ /*fake_override*/ fun <get-MIN_VALUE>(): kotlin.Double
public abstract override /*1*/ /*fake_override*/ val NEGATIVE_INFINITY: kotlin.Double
public abstract override /*1*/ /*fake_override*/ fun <get-NEGATIVE_INFINITY>(): kotlin.Double
public abstract override /*1*/ /*fake_override*/ val NaN: kotlin.Double
public abstract override /*1*/ /*fake_override*/ fun <get-NaN>(): kotlin.Double
public abstract override /*1*/ /*fake_override*/ val POSITIVE_INFINITY: kotlin.Double
public abstract override /*1*/ /*fake_override*/ fun <get-POSITIVE_INFINITY>(): kotlin.Double
public final val MAX_VALUE: kotlin.Double
public final fun <get-MAX_VALUE>(): kotlin.Double
public final val MIN_VALUE: kotlin.Double
public final fun <get-MIN_VALUE>(): kotlin.Double
public final val NEGATIVE_INFINITY: kotlin.Double
public final fun <get-NEGATIVE_INFINITY>(): kotlin.Double
public final val NaN: kotlin.Double
public final fun <get-NaN>(): kotlin.Double
public final val POSITIVE_INFINITY: kotlin.Double
public final fun <get-POSITIVE_INFINITY>(): kotlin.Double
}
}
@@ -541,18 +541,18 @@ public final class Float : kotlin.Number, kotlin.Comparable<kotlin.Float> {
public final operator fun unaryMinus(): kotlin.Float
public final operator fun unaryPlus(): kotlin.Float
public companion object Companion : kotlin.FloatingPointConstants<kotlin.Float> {
public companion object Companion {
/*primary*/ private constructor Companion()
public abstract override /*1*/ /*fake_override*/ val MAX_VALUE: kotlin.Float
public abstract override /*1*/ /*fake_override*/ fun <get-MAX_VALUE>(): kotlin.Float
public abstract override /*1*/ /*fake_override*/ val MIN_VALUE: kotlin.Float
public abstract override /*1*/ /*fake_override*/ fun <get-MIN_VALUE>(): kotlin.Float
public abstract override /*1*/ /*fake_override*/ val NEGATIVE_INFINITY: kotlin.Float
public abstract override /*1*/ /*fake_override*/ fun <get-NEGATIVE_INFINITY>(): kotlin.Float
public abstract override /*1*/ /*fake_override*/ val NaN: kotlin.Float
public abstract override /*1*/ /*fake_override*/ fun <get-NaN>(): kotlin.Float
public abstract override /*1*/ /*fake_override*/ val POSITIVE_INFINITY: kotlin.Float
public abstract override /*1*/ /*fake_override*/ fun <get-POSITIVE_INFINITY>(): kotlin.Float
public final val MAX_VALUE: kotlin.Float
public final fun <get-MAX_VALUE>(): kotlin.Float
public final val MIN_VALUE: kotlin.Float
public final fun <get-MIN_VALUE>(): kotlin.Float
public final val NEGATIVE_INFINITY: kotlin.Float
public final fun <get-NEGATIVE_INFINITY>(): kotlin.Float
public final val NaN: kotlin.Float
public final fun <get-NaN>(): kotlin.Float
public final val POSITIVE_INFINITY: kotlin.Float
public final fun <get-POSITIVE_INFINITY>(): kotlin.Float
}
}
@@ -573,19 +573,6 @@ public abstract class FloatIterator : kotlin.Iterator<kotlin.Float> {
public abstract fun nextFloat(): kotlin.Float
}
public interface FloatingPointConstants</*0*/ T> {
public abstract val MAX_VALUE: T
public abstract fun <get-MAX_VALUE>(): T
public abstract val MIN_VALUE: T
public abstract fun <get-MIN_VALUE>(): T
public abstract val NEGATIVE_INFINITY: T
public abstract fun <get-NEGATIVE_INFINITY>(): T
public abstract val NaN: T
public abstract fun <get-NaN>(): T
public abstract val POSITIVE_INFINITY: T
public abstract fun <get-POSITIVE_INFINITY>(): T
}
public interface Function</*0*/ out R> {
}
@@ -654,12 +641,12 @@ public final class Int : kotlin.Number, kotlin.Comparable<kotlin.Int> {
public final infix fun ushr(/*0*/ bitCount: kotlin.Int): kotlin.Int
public final infix fun xor(/*0*/ other: kotlin.Int): kotlin.Int
public companion object Companion : kotlin.IntegerConstants<kotlin.Int> {
public companion object Companion {
/*primary*/ private constructor Companion()
public abstract override /*1*/ /*fake_override*/ val MAX_VALUE: kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun <get-MAX_VALUE>(): kotlin.Int
public abstract override /*1*/ /*fake_override*/ val MIN_VALUE: kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun <get-MIN_VALUE>(): kotlin.Int
public const final val MAX_VALUE: kotlin.Int
public final fun <get-MAX_VALUE>(): kotlin.Int
public const final val MIN_VALUE: kotlin.Int
public final fun <get-MIN_VALUE>(): kotlin.Int
}
}
@@ -747,13 +734,6 @@ public final class IntRange : kotlin.IntProgression, kotlin.ClosedRange<kotlin.I
}
}
public interface IntegerConstants</*0*/ T> {
public abstract val MAX_VALUE: T
public abstract fun <get-MAX_VALUE>(): T
public abstract val MIN_VALUE: T
public abstract fun <get-MIN_VALUE>(): T
}
public interface Iterable</*0*/ out T> {
public abstract operator fun iterator(): kotlin.Iterator<T>
}
@@ -848,12 +828,12 @@ public final class Long : kotlin.Number, kotlin.Comparable<kotlin.Long> {
public final infix fun ushr(/*0*/ bitCount: kotlin.Int): kotlin.Long
public final infix fun xor(/*0*/ other: kotlin.Long): kotlin.Long
public companion object Companion : kotlin.IntegerConstants<kotlin.Long> {
public companion object Companion {
/*primary*/ private constructor Companion()
public abstract override /*1*/ /*fake_override*/ val MAX_VALUE: kotlin.Long
public abstract override /*1*/ /*fake_override*/ fun <get-MAX_VALUE>(): kotlin.Long
public abstract override /*1*/ /*fake_override*/ val MIN_VALUE: kotlin.Long
public abstract override /*1*/ /*fake_override*/ fun <get-MIN_VALUE>(): kotlin.Long
public const final val MAX_VALUE: kotlin.Long
public final fun <get-MAX_VALUE>(): kotlin.Long
public const final val MIN_VALUE: kotlin.Long
public final fun <get-MIN_VALUE>(): kotlin.Long
}
}
@@ -1177,12 +1157,12 @@ public final class Short : kotlin.Number, kotlin.Comparable<kotlin.Short> {
public final operator fun unaryMinus(): kotlin.Int
public final operator fun unaryPlus(): kotlin.Int
public companion object Companion : kotlin.IntegerConstants<kotlin.Short> {
public companion object Companion {
/*primary*/ private constructor Companion()
public abstract override /*1*/ /*fake_override*/ val MAX_VALUE: kotlin.Short
public abstract override /*1*/ /*fake_override*/ fun <get-MAX_VALUE>(): kotlin.Short
public abstract override /*1*/ /*fake_override*/ val MIN_VALUE: kotlin.Short
public abstract override /*1*/ /*fake_override*/ fun <get-MIN_VALUE>(): kotlin.Short
public const final val MAX_VALUE: kotlin.Short
public final fun <get-MAX_VALUE>(): kotlin.Short
public const final val MIN_VALUE: kotlin.Short
public final fun <get-MIN_VALUE>(): kotlin.Short
}
}
@@ -6,7 +6,6 @@ fun box(): String {
testInCall()
testDoubleConstants()
testFloatConstants()
testCallInterface()
testLocalFun()
testTopLevelFun()
testVarTopField()
@@ -60,20 +59,6 @@ fun testFloatConstants() {
myAssertEquals(ni, Float.NEGATIVE_INFINITY)
}
fun testCallInterface() {
fun <T> floatPointConstants(a: FloatingPointConstants<T>) {
val pi = a.POSITIVE_INFINITY
val ni = a.NEGATIVE_INFINITY
val nan = a.NaN
myAssertEquals(pi, a.POSITIVE_INFINITY)
myAssertEquals(ni, a.NEGATIVE_INFINITY)
}
floatPointConstants(Double)
floatPointConstants(Float)
}
fun testLocalFun() {
fun Int.Companion.LocalFun() : String = "LocalFun"
myAssertEquals("LocalFun", Int.LocalFun())