[JS IR BE] Implement Long.rangeTo and unmute tests
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val r = 1.toLong()..2
|
||||
var s = ""
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val l: Long = 1
|
||||
val l2: Long = 2
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
|
||||
fun f(l : Long) {
|
||||
l.rangeTo(l)
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
|
||||
Vendored
-1
@@ -1,5 +1,4 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val shouldBeTrue = 555555555555555555L in 123456789123456789L..987654321987654321L
|
||||
if (!shouldBeTrue) return "Fail 1"
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun abs(x: Int) = if (x < 0) -x else x
|
||||
fun abs(x: Long) = if (x < 0) -x else x
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun test1(): Long {
|
||||
var s = 0L
|
||||
for (i in 1L..4) {
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
const val M = Long.MAX_VALUE
|
||||
|
||||
fun box(): String {
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// EXPECTED_REACHABLE_NODES: 1232
|
||||
package foo
|
||||
|
||||
|
||||
@@ -199,19 +199,17 @@ public class Long internal constructor(
|
||||
/** Returns the negative of this value. */
|
||||
public operator fun unaryMinus(): Long = inv() + 1L
|
||||
|
||||
/* TODO
|
||||
/** Creates a range from this value to the specified [other] value. */
|
||||
public operator fun rangeTo(other: Byte): LongRange
|
||||
public operator fun rangeTo(other: Byte): LongRange = rangeTo(other.toLong())
|
||||
|
||||
/** Creates a range from this value to the specified [other] value. */
|
||||
public operator fun rangeTo(other: Short): LongRange
|
||||
public operator fun rangeTo(other: Short): LongRange = rangeTo(other.toLong())
|
||||
|
||||
/** Creates a range from this value to the specified [other] value. */
|
||||
public operator fun rangeTo(other: Int): LongRange
|
||||
public operator fun rangeTo(other: Int): LongRange = rangeTo(other.toLong())
|
||||
|
||||
/** Creates a range from this value to the specified [other] value. */
|
||||
public operator fun rangeTo(other: Long): LongRange
|
||||
*/
|
||||
public operator fun rangeTo(other: Long): LongRange = LongRange(this, other)
|
||||
|
||||
/** Shifts this value left by the [bitCount] number of bits. */
|
||||
public infix fun shl(bitCount: Int): Long = shiftLeft(bitCount)
|
||||
|
||||
Reference in New Issue
Block a user