Merge boxWithStdlib testData into box, delete BoxWithStdlib test
This commit is contained in:
committed by
Alexander Udalov
parent
22bfc9786a
commit
06a67e6602
@@ -0,0 +1,33 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class B(var s: Int = 0) {
|
||||
|
||||
}
|
||||
|
||||
object A {
|
||||
|
||||
fun test1(v: B) {
|
||||
v += B(1000)
|
||||
}
|
||||
|
||||
@JvmStatic operator fun B.plusAssign(b: B) {
|
||||
this.s += b.s
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val b1 = B(11)
|
||||
|
||||
with(A) {
|
||||
b1 += B(1000)
|
||||
}
|
||||
|
||||
if (b1.s != 1011) return "fail 1"
|
||||
|
||||
val b = B(11)
|
||||
A.test1(b)
|
||||
if (b.s != 1011) return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user