JS: Provide MIN_VALUE and MAX_VALUE member constants for Int, Long, Short and Byte companion objects.

JVM: Make MIN_VALUE and MAX_VALUE not an extension but member constant properties of Int, Long, Short and Byte companion objects.
This commit is contained in:
Ilya Gorbunov
2015-05-14 19:19:17 +03:00
parent c4b881c458
commit f18b9caa8d
10 changed files with 143 additions and 52 deletions
@@ -28,10 +28,26 @@ private object FloatCompanionObject : FloatingPointConstants<Float> {
override val NaN : Float = js("Number.NaN")
}
private object IntCompanionObject {}
private object LongCompanionObject {}
private object ShortCompanionObject {}
private object ByteCompanionObject {}
private object IntCompanionObject : IntegerConstants<Int> {
override val MIN_VALUE: Int = -0x80000000
override val MAX_VALUE: Int = 0x7FFFFFFF
}
private object LongCompanionObject : IntegerConstants<Long> {
override val MIN_VALUE: Long = js("Kotlin.Long.MIN_VALUE")
override val MAX_VALUE: Long = js("Kotlin.Long.MAX_VALUE")
}
private object ShortCompanionObject : IntegerConstants<Short> {
override val MIN_VALUE: Short = -0x8000
override val MAX_VALUE: Short = 0x7FFF
}
private object ByteCompanionObject : IntegerConstants<Byte> {
override val MIN_VALUE: Byte = -0x80
override val MAX_VALUE: Byte = 0x7F
}
private object CharCompanionObject {}
private object StringCompanionObject {}