Ensure that no boolean negation is generated for !in expression
#KT-18777 Fixed Target versions 1.1.4
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: Ints.kt
|
||||
val ints = listOf(1, 2, 3)
|
||||
|
||||
// FILE: Test.kt
|
||||
fun test1(i: Int) =
|
||||
if (i in ints) "Yes" else "No"
|
||||
|
||||
fun test2(i: Int) =
|
||||
if (i !in ints) "Yes" else "No"
|
||||
|
||||
// @TestKt.class:
|
||||
// 0 ICONST_0
|
||||
// 0 ICONST_1
|
||||
// 0 IXOR
|
||||
@@ -0,0 +1,16 @@
|
||||
fun testInt(x: Int, a: Int, b: Int) =
|
||||
if (x !in a .. b) "no" else "yes"
|
||||
|
||||
fun testLong(x: Long, a: Long, b: Long) =
|
||||
if (x !in a .. b) "no" else "yes"
|
||||
|
||||
fun testDouble(x: Double, a: Double, b: Double) =
|
||||
if (x !in a .. b) "no" else "yes"
|
||||
|
||||
fun testString(x: String, a: String, b: String) =
|
||||
if (x !in a .. b) "no" else "yes"
|
||||
|
||||
fun testCollection(x: Any, xs: List<Any>) =
|
||||
if (x !in xs) "no" else "yes"
|
||||
|
||||
// 0 IXOR
|
||||
Reference in New Issue
Block a user