tests: Update external tests (1.1.2-dev-393)
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
fun box(): String {
|
||||
val aByte: Array<Byte> = arrayOf<Byte>(1)
|
||||
val bByte: ByteArray = byteArrayOf(1)
|
||||
|
||||
val aShort: Array<Short> = arrayOf<Short>(1)
|
||||
val bShort: ShortArray = shortArrayOf(1)
|
||||
|
||||
val aInt: Array<Int> = arrayOf<Int>(1)
|
||||
val bInt: IntArray = intArrayOf(1)
|
||||
|
||||
val aLong: Array<Long> = arrayOf<Long>(1)
|
||||
val bLong: LongArray = longArrayOf(1)
|
||||
|
||||
val aFloat: Array<Float> = arrayOf<Float>(1.0f)
|
||||
val bFloat: FloatArray = floatArrayOf(1.0f)
|
||||
|
||||
val aDouble: Array<Double> = arrayOf<Double>(1.0)
|
||||
val bDouble: DoubleArray = doubleArrayOf(1.0)
|
||||
|
||||
aByte[0]--
|
||||
bByte[0]--
|
||||
if (aByte[0] != bByte[0]) return "Failed post-decrement Byte: ${aByte[0]} != ${bByte[0]}"
|
||||
|
||||
aByte[0]++
|
||||
bByte[0]++
|
||||
if (aByte[0] != bByte[0]) return "Failed post-increment Byte: ${aByte[0]} != ${bByte[0]}"
|
||||
|
||||
aShort[0]--
|
||||
bShort[0]--
|
||||
if (aShort[0] != bShort[0]) return "Failed post-decrement Short: ${aShort[0]} != ${bShort[0]}"
|
||||
|
||||
aShort[0]++
|
||||
bShort[0]++
|
||||
if (aShort[0] != bShort[0]) return "Failed post-increment Short: ${aShort[0]} != ${bShort[0]}"
|
||||
|
||||
aInt[0]--
|
||||
bInt[0]--
|
||||
if (aInt[0] != bInt[0]) return "Failed post-decrement Int: ${aInt[0]} != ${bInt[0]}"
|
||||
|
||||
aInt[0]++
|
||||
bInt[0]++
|
||||
if (aInt[0] != bInt[0]) return "Failed post-increment Int: ${aInt[0]} != ${bInt[0]}"
|
||||
|
||||
aLong[0]--
|
||||
bLong[0]--
|
||||
if (aLong[0] != bLong[0]) return "Failed post-decrement Long: ${aLong[0]} != ${bLong[0]}"
|
||||
|
||||
aLong[0]++
|
||||
bLong[0]++
|
||||
if (aLong[0] != bLong[0]) return "Failed post-increment Long: ${aLong[0]} != ${bLong[0]}"
|
||||
|
||||
aFloat[0]++
|
||||
bFloat[0]++
|
||||
if (aFloat[0] != bFloat[0]) return "Failed post-increment Float: ${aFloat[0]} != ${bFloat[0]}"
|
||||
|
||||
aFloat[0]--
|
||||
bFloat[0]--
|
||||
if (aFloat[0] != bFloat[0]) return "Failed post-decrement Float: ${aFloat[0]} != ${bFloat[0]}"
|
||||
|
||||
aDouble[0]++
|
||||
bDouble[0]++
|
||||
if (aDouble[0] != bDouble[0]) return "Failed post-increment Double: ${aDouble[0]} != ${bDouble[0]}"
|
||||
|
||||
aDouble[0]--
|
||||
bDouble[0]--
|
||||
if (aDouble[0] != bDouble[0]) return "Failed post-decrement Double: ${aDouble[0]} != ${bDouble[0]}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public fun box() : String {
|
||||
var i : Int?
|
||||
i = 10
|
||||
// assignPlus on a smart cast should work
|
||||
i += 1
|
||||
|
||||
return if (11 == i) "OK" else "fail i = $i"
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// WITH_RUNTIME
|
||||
import kotlin.test.*
|
||||
|
||||
var log = ""
|
||||
var result = 20
|
||||
var doubleResult = 40.0
|
||||
|
||||
fun <T> id(value: T) = value
|
||||
|
||||
fun box(): String {
|
||||
result += if (id("true") == "true") {
|
||||
result += 10
|
||||
log += "true chosen;"
|
||||
3
|
||||
}
|
||||
else {
|
||||
4
|
||||
}
|
||||
|
||||
assertEquals(23, result)
|
||||
|
||||
doubleResult += if (id("true") == "true") {
|
||||
doubleResult += 100
|
||||
log += "true chosen;"
|
||||
2
|
||||
}
|
||||
else {
|
||||
5
|
||||
}
|
||||
|
||||
assertEquals(42, (doubleResult + 0.1).toInt())
|
||||
assertEquals("true chosen;true chosen;", log)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
object A {
|
||||
var x = 0
|
||||
|
||||
operator fun get(i1: Int, i2: Int, i3: Int): Int = x
|
||||
|
||||
operator fun set(i1: Int, i2: Int, i3: Int, value: Int) {
|
||||
x = value
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A.x = 0
|
||||
val xx = A[1, 2, 3]++
|
||||
return if (xx != 0 || A.x != 1) "Failed" else "OK"
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
class AByte(var value: Byte) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: Byte) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
class AShort(var value: Short) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: Short) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
class AInt(var value: Int) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: Int) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
class ALong(var value: Long) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: Long) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
class AFloat(var value: Float) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: Float) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
class ADouble(var value: Double) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: Double) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val aByte = AByte(1)
|
||||
var bByte: Byte = 1
|
||||
|
||||
val aShort = AShort(1)
|
||||
var bShort: Short = 1
|
||||
|
||||
val aInt = AInt(1)
|
||||
var bInt: Int = 1
|
||||
|
||||
val aLong = ALong(1)
|
||||
var bLong: Long = 1
|
||||
|
||||
val aFloat = AFloat(1.0f)
|
||||
var bFloat: Float = 1.0f
|
||||
|
||||
val aDouble = ADouble(1.0)
|
||||
var bDouble: Double = 1.0
|
||||
|
||||
aByte[0]++
|
||||
bByte++
|
||||
if (aByte[0] != bByte) return "Failed post-increment Byte: ${aByte[0]} != $bByte"
|
||||
|
||||
aByte[0]--
|
||||
bByte--
|
||||
if (aByte[0] != bByte) return "Failed post-decrement Byte: ${aByte[0]} != $bByte"
|
||||
|
||||
aShort[0]++
|
||||
bShort++
|
||||
if (aShort[0] != bShort) return "Failed post-increment Short: ${aShort[0]} != $bShort"
|
||||
|
||||
aShort[0]--
|
||||
bShort--
|
||||
if (aShort[0] != bShort) return "Failed post-decrement Short: ${aShort[0]} != $bShort"
|
||||
|
||||
aInt[0]++
|
||||
bInt++
|
||||
if (aInt[0] != bInt) return "Failed post-increment Int: ${aInt[0]} != $bInt"
|
||||
|
||||
aInt[0]--
|
||||
bInt--
|
||||
if (aInt[0] != bInt) return "Failed post-decrement Int: ${aInt[0]} != $bInt"
|
||||
|
||||
aLong[0]++
|
||||
bLong++
|
||||
if (aLong[0] != bLong) return "Failed post-increment Long: ${aLong[0]} != $bLong"
|
||||
|
||||
aLong[0]--
|
||||
bLong--
|
||||
if (aLong[0] != bLong) return "Failed post-decrement Long: ${aLong[0]} != $bLong"
|
||||
|
||||
aFloat[0]++
|
||||
bFloat++
|
||||
if (aFloat[0] != bFloat) return "Failed post-increment Float: ${aFloat[0]} != $bFloat"
|
||||
|
||||
aFloat[0]--
|
||||
bFloat--
|
||||
if (aFloat[0] != bFloat) return "Failed post-decrement Float: ${aFloat[0]} != $bFloat"
|
||||
|
||||
aDouble[0]++
|
||||
bDouble++
|
||||
if (aDouble[0] != bDouble) return "Failed post-increment Double: ${aDouble[0]} != $bDouble"
|
||||
|
||||
aDouble[0]--
|
||||
bDouble--
|
||||
if (aDouble[0] != bDouble) return "Failed post-decrement Double: ${aDouble[0]} != $bDouble"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
operator fun Long.get(i: Int) = this
|
||||
operator fun Long.set(i: Int, newValue: Long) {}
|
||||
|
||||
fun box(): String {
|
||||
var x = 0L
|
||||
val y = x[0]++
|
||||
return if (y == 0L) "OK" else "Failed, y=$y"
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
class A<T>(var value: T) {
|
||||
operator fun get(i: Int) = value
|
||||
|
||||
operator fun set(i: Int, newValue: T) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val aByte = A<Byte>(1)
|
||||
var bByte: Byte = 1
|
||||
|
||||
val aShort = A<Short>(1)
|
||||
var bShort: Short = 1
|
||||
|
||||
val aInt = A<Int>(1)
|
||||
var bInt: Int = 1
|
||||
|
||||
val aLong = A<Long>(1)
|
||||
var bLong: Long = 1
|
||||
|
||||
val aFloat = A<Float>(1.0f)
|
||||
var bFloat: Float = 1.0f
|
||||
|
||||
val aDouble = A<Double>(1.0)
|
||||
var bDouble: Double = 1.0
|
||||
|
||||
aByte[0]++
|
||||
bByte++
|
||||
if (aByte[0] != bByte) return "Failed post-increment Byte: ${aByte[0]} != $bByte"
|
||||
|
||||
aByte[0]--
|
||||
bByte--
|
||||
if (aByte[0] != bByte) return "Failed post-decrement Byte: ${aByte[0]} != $bByte"
|
||||
|
||||
aShort[0]++
|
||||
bShort++
|
||||
if (aShort[0] != bShort) return "Failed post-increment Short: ${aShort[0]} != $bShort"
|
||||
|
||||
aShort[0]--
|
||||
bShort--
|
||||
if (aShort[0] != bShort) return "Failed post-decrement Short: ${aShort[0]} != $bShort"
|
||||
|
||||
aInt[0]++
|
||||
bInt++
|
||||
if (aInt[0] != bInt) return "Failed post-increment Int: ${aInt[0]} != $bInt"
|
||||
|
||||
aInt[0]--
|
||||
bInt--
|
||||
if (aInt[0] != bInt) return "Failed post-decrement Int: ${aInt[0]} != $bInt"
|
||||
|
||||
aLong[0]++
|
||||
bLong++
|
||||
if (aLong[0] != bLong) return "Failed post-increment Long: ${aLong[0]} != $bLong"
|
||||
|
||||
aLong[0]--
|
||||
bLong--
|
||||
if (aLong[0] != bLong) return "Failed post-decrement Long: ${aLong[0]} != $bLong"
|
||||
|
||||
aFloat[0]++
|
||||
bFloat++
|
||||
if (aFloat[0] != bFloat) return "Failed post-increment Float: ${aFloat[0]} != $bFloat"
|
||||
|
||||
aFloat[0]--
|
||||
bFloat--
|
||||
if (aFloat[0] != bFloat) return "Failed post-decrement Float: ${aFloat[0]} != $bFloat"
|
||||
|
||||
aDouble[0]++
|
||||
bDouble++
|
||||
if (aDouble[0] != bDouble) return "Failed post-increment Double: ${aDouble[0]} != $bDouble"
|
||||
|
||||
aDouble[0]--
|
||||
bDouble--
|
||||
if (aDouble[0] != bDouble) return "Failed post-decrement Double: ${aDouble[0]} != $bDouble"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
object ExtProvider {
|
||||
operator fun Long.get(i: Int) = this
|
||||
operator fun Long.set(i: Int, newValue: Long) {}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
with (ExtProvider) {
|
||||
var x = 0L
|
||||
val y = x[0]++
|
||||
return if (y == 0L) "OK" else "Failed, y=$y"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
val aByte = arrayListOf<Byte>(1)
|
||||
var bByte: Byte = 1
|
||||
|
||||
val aShort = arrayListOf<Short>(1)
|
||||
var bShort: Short = 1
|
||||
|
||||
val aInt = arrayListOf<Int>(1)
|
||||
var bInt: Int = 1
|
||||
|
||||
val aLong = arrayListOf<Long>(1)
|
||||
var bLong: Long = 1
|
||||
|
||||
val aFloat = arrayListOf<Float>(1.0f)
|
||||
var bFloat: Float = 1.0f
|
||||
|
||||
val aDouble = arrayListOf<Double>(1.0)
|
||||
var bDouble: Double = 1.0
|
||||
|
||||
aByte[0]--
|
||||
bByte--
|
||||
|
||||
if (aByte[0] != bByte) return "Failed post-decrement Byte: ${aByte[0]} != $bByte"
|
||||
|
||||
aByte[0]++
|
||||
bByte++
|
||||
|
||||
if (aByte[0] != bByte) return "Failed post-increment Byte: ${aByte[0]} != $bByte"
|
||||
|
||||
aShort[0]--
|
||||
bShort--
|
||||
|
||||
if (aShort[0] != bShort) return "Failed post-decrement Short: ${aShort[0]} != $bShort"
|
||||
|
||||
aShort[0]++
|
||||
bShort++
|
||||
|
||||
if (aShort[0] != bShort) return "Failed post-increment Short: ${aShort[0]} != $bShort"
|
||||
|
||||
aInt[0]--
|
||||
bInt--
|
||||
|
||||
if (aInt[0] != bInt) return "Failed post-decrement Int: ${aInt[0]} != $bInt"
|
||||
|
||||
aInt[0]++
|
||||
bInt++
|
||||
|
||||
if (aInt[0] != bInt) return "Failed post-increment Int: ${aInt[0]} != $bInt"
|
||||
|
||||
aLong[0]--
|
||||
bLong--
|
||||
|
||||
if (aLong[0] != bLong) return "Failed post-decrement Long: ${aLong[0]} != $bLong"
|
||||
|
||||
aLong[0]++
|
||||
bLong++
|
||||
|
||||
if (aLong[0] != bLong) return "Failed post-increment Long: ${aLong[0]} != $bLong"
|
||||
|
||||
aFloat[0]--
|
||||
bFloat--
|
||||
|
||||
if (aFloat[0] != bFloat) return "Failed post-decrement Float: ${aFloat[0]} != $bFloat"
|
||||
|
||||
aFloat[0]++
|
||||
bFloat++
|
||||
|
||||
if (aFloat[0] != bFloat) return "Failed post-increment Float: ${aFloat[0]} != $bFloat"
|
||||
|
||||
aDouble[0]--
|
||||
bDouble--
|
||||
|
||||
if (aDouble[0] != bDouble) return "Failed post-decrement Double: ${aDouble[0]} != $bDouble"
|
||||
|
||||
aDouble[0]++
|
||||
bDouble++
|
||||
|
||||
if (aDouble[0] != bDouble) return "Failed post-increment Double: ${aDouble[0]} != $bDouble"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
fun box(): String {
|
||||
var aByte: Byte? = 0
|
||||
var bByte: Byte = 0
|
||||
|
||||
var aShort: Short? = 0
|
||||
var bShort: Short = 0
|
||||
|
||||
var aInt: Int? = 0
|
||||
var bInt: Int = 0
|
||||
|
||||
var aLong: Long? = 0
|
||||
var bLong: Long = 0
|
||||
|
||||
var aFloat: Float? = 0.0f
|
||||
var bFloat: Float = 0.0f
|
||||
|
||||
var aDouble: Double? = 0.0
|
||||
var bDouble: Double = 0.0
|
||||
|
||||
if (aByte != null) aByte--
|
||||
bByte--
|
||||
if (aByte != bByte) return "Failed post-decrement Byte: $aByte != $bByte"
|
||||
|
||||
if (aByte != null) aByte++
|
||||
bByte++
|
||||
if (aByte != bByte) return "Failed post-increment Byte: $aByte != $bByte"
|
||||
|
||||
if (aShort != null) aShort--
|
||||
bShort--
|
||||
if (aShort != bShort) return "Failed post-decrement Short: $aShort != $bShort"
|
||||
|
||||
if (aShort != null) aShort++
|
||||
bShort++
|
||||
if (aShort != bShort) return "Failed post-increment Short: $aShort != $bShort"
|
||||
|
||||
if (aInt != null) aInt--
|
||||
bInt--
|
||||
if (aInt != bInt) return "Failed post-decrement Int: $aInt != $bInt"
|
||||
|
||||
if (aInt != null) aInt++
|
||||
bInt++
|
||||
if (aInt != bInt) return "Failed post-increment Int: $aInt != $bInt"
|
||||
|
||||
if (aLong != null) aLong--
|
||||
bLong--
|
||||
if (aLong != bLong) return "Failed post-decrement Long: $aLong != $bLong"
|
||||
|
||||
if (aLong != null) aLong++
|
||||
bLong++
|
||||
if (aLong != bLong) return "Failed post-increment Long: $aLong != $bLong"
|
||||
|
||||
if (aFloat != null) aFloat--
|
||||
bFloat--
|
||||
if (aFloat != bFloat) return "Failed post-decrement Float: $aFloat != $bFloat"
|
||||
|
||||
if (aFloat != null) aFloat++
|
||||
bFloat++
|
||||
if (aFloat != bFloat) return "Failed post-increment Float: $aFloat != $bFloat"
|
||||
|
||||
if (aDouble != null) aDouble--
|
||||
bDouble--
|
||||
if (aDouble != bDouble) return "Failed post-decrement Double: $aDouble != $bDouble"
|
||||
|
||||
if (aDouble != null) aDouble++
|
||||
bDouble++
|
||||
if (aDouble != bDouble) return "Failed post-increment Double: $aDouble != $bDouble"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
public fun box() : String {
|
||||
var i : Int?
|
||||
i = 10
|
||||
// We have "double" smart cast here:
|
||||
// first on i and second on i++
|
||||
// Back-end should NOT think that both i and j are Int
|
||||
val j: Int = i++
|
||||
|
||||
return if (j == 10 && 11 == i) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
interface Base
|
||||
class Derived: Base
|
||||
class Another: Base
|
||||
operator fun Base.inc(): Derived { return Derived() }
|
||||
|
||||
public fun box() : String {
|
||||
var i : Base
|
||||
i = Another()
|
||||
val j = i++
|
||||
|
||||
return if (j is Another && i is Derived) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
open class Base
|
||||
class Derived: Base()
|
||||
operator fun Derived.inc(): Derived { return Derived() }
|
||||
|
||||
public fun box() : String {
|
||||
var i : Base
|
||||
i = Derived()
|
||||
val j = i++
|
||||
|
||||
return if (j is Derived && i is Derived) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public fun box() : String {
|
||||
var i : Short?
|
||||
i = 10
|
||||
// Postfix increment on a smart casted short should work
|
||||
val j = i++
|
||||
|
||||
return if (j!!.toInt() == 10 && i!!.toInt() == 11) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public fun box() : String {
|
||||
var i : Int?
|
||||
i = 10
|
||||
// Postfix increment on a smart cast should work
|
||||
// Specific: i.inc() type is Int but i and j types are both Int?
|
||||
val j = i++
|
||||
|
||||
return if (j == 10 && 11 == i) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class MyClass
|
||||
|
||||
operator fun MyClass?.inc(): MyClass? = null
|
||||
|
||||
public fun box() : String {
|
||||
var i : MyClass?
|
||||
i = MyClass()
|
||||
val j = i++
|
||||
|
||||
return if (j is MyClass && null == i) "OK" else "fail i = $i j = $j"
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
operator fun Int?.inc(): Int? = this
|
||||
|
||||
fun init(): Int? { return 10 }
|
||||
|
||||
public fun box() : String {
|
||||
var i : Int? = init()
|
||||
val j = i++
|
||||
|
||||
return if (j == 10 && 10 == i) "OK" else "fail i = $i j = $j"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
interface Base
|
||||
class Derived: Base
|
||||
class Another: Base
|
||||
operator fun Base.inc(): Derived { return Derived() }
|
||||
|
||||
public fun box() : String {
|
||||
var i : Base
|
||||
i = Another()
|
||||
val j = ++i
|
||||
|
||||
return if (j is Derived && i is Derived) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
open class Base
|
||||
class Derived: Base()
|
||||
operator fun Derived.inc(): Derived { return Derived() }
|
||||
|
||||
public fun box() : String {
|
||||
var i : Base
|
||||
i = Derived()
|
||||
val j = ++i
|
||||
|
||||
return if (j is Derived && i is Derived) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public fun box() : String {
|
||||
var i : Int?
|
||||
i = 10
|
||||
// Prefix increment on a smart cast should work
|
||||
val j = ++i
|
||||
|
||||
return if (j == 11 && 11 == i) "OK" else "fail j = $j i = $i"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class MyClass
|
||||
|
||||
operator fun MyClass?.inc(): MyClass? = null
|
||||
|
||||
public fun box() : String {
|
||||
var i : MyClass?
|
||||
i = MyClass()
|
||||
val j = ++i
|
||||
|
||||
return if (j == null && null == i) "OK" else "fail i = $i j = $j"
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
operator fun Int?.inc(): Int? = this
|
||||
|
||||
fun init(): Int? { return 10 }
|
||||
|
||||
public fun box() : String {
|
||||
var i : Int? = init()
|
||||
val j = ++i
|
||||
|
||||
return if (j == 10 && 10 == i) "OK" else "fail i = $i j = $j"
|
||||
}
|
||||
Reference in New Issue
Block a user