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,27 @@ private object FloatCompanionObject : FloatingPointConstants<Float> {
override val NaN : Float = java.lang.Float.NaN
}
private object IntCompanionObject {}
private object LongCompanionObject {}
private object ShortCompanionObject {}
private object ByteCompanionObject {}
private object IntCompanionObject : IntegerConstants<Int> {
override val MIN_VALUE: Int = java.lang.Integer.MIN_VALUE
override val MAX_VALUE: Int = java.lang.Integer.MAX_VALUE
}
private object LongCompanionObject : IntegerConstants<Long> {
override val MIN_VALUE: Long = java.lang.Long.MIN_VALUE
override val MAX_VALUE: Long = java.lang.Long.MAX_VALUE
}
private object ShortCompanionObject : IntegerConstants<Short> {
override val MIN_VALUE: Short = java.lang.Short.MIN_VALUE
override val MAX_VALUE: Short = java.lang.Short.MAX_VALUE
}
private object ByteCompanionObject : IntegerConstants<Byte> {
override val MIN_VALUE: Byte = java.lang.Byte.MIN_VALUE
override val MAX_VALUE: Byte = java.lang.Byte.MAX_VALUE
}
private object CharCompanionObject {}
private object StringCompanionObject {}