[JS_IR] Enable RangeContainsLowering optimizations.

This commit is contained in:
Mark Punzalan
2020-09-03 00:49:14 -07:00
committed by Roman
parent 88755a8d20
commit 16ab11289c
11 changed files with 105 additions and 137 deletions
@@ -1,9 +1,5 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
import kotlin.test.*
class Value(val x: Int) : Comparable<Value> {
override fun compareTo(other: Value): Int {
@@ -22,8 +18,8 @@ class ValueRange(override val start: Value,
operator fun Value.rangeTo(other: Value): ClosedRange<Value> = ValueRange(this, other)
fun box(): String {
assert(Value(42) in Value(1)..Value(2))
assert(Value(41) !in Value(40)..Value(42))
assertTrue(Value(42) in Value(1)..Value(2))
assertTrue(Value(41) !in Value(40)..Value(42))
return "OK"
}