Fix tests for in/in! with primitive range literals

- ClosedFloatingPointRange<T>
- IntRange, etc
- extensions in kotlin.ranges for ranges of Byte/Int/Short
This commit is contained in:
Dmitry Petrov
2017-06-30 17:25:12 +03:00
parent 5decf65d6a
commit 05cad83c79
5 changed files with 80 additions and 68 deletions
@@ -1,28 +1,20 @@
// WITH_RUNTIME
fun Byte.in2(left: Byte, right: Byte): Boolean {
return this in left..right
}
fun Byte.inByte(left: Byte, right: Byte) = this in left..right
fun inInt(x: Int, left: Int, right: Int): Boolean {
return x in left..right
}
fun Short.inInt(left: Int, right: Int) = this in left .. right
fun inDouble(x: Double, left: Double, right: Double): Boolean {
return x in left..right
}
fun Short.inByte(left: Byte, right: Byte) = this in left..right
fun inFloat(x: Float, left: Float, right: Float): Boolean {
return x in left..right
}
fun inInt(x: Int, left: Int, right: Int) = x in left..right
fun inLong(x: Long, left: Long, right: Long): Boolean {
return x in left..right
}
fun inDouble(x: Double, left: Double, right: Double) = x in left..right
fun inCharWithNullableParameter(x: Char?, left: Char, right: Char): Boolean {
return x!! in left..right
}
fun inFloat(x: Float, left: Float, right: Float) = x in left..right
fun inLong(x: Long, left: Long, right: Long) = x in left..right
fun inCharWithNullableParameter(x: Char?, left: Char, right: Char) = x!! in left..right
// 0 INVOKESPECIAL
// 0 NEW