JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 12:37:13 +03:00
parent efb82a044f
commit cdf2212c73
70 changed files with 484 additions and 749 deletions
@@ -0,0 +1,16 @@
package foo
open class Foo<out T>(open val value: T)
open class MutableFoo<T>(override var value: T): Foo<T>(value)
operator fun <T> Foo<T>.plus(x: T): Foo<T> = Foo(x)
// overloading:
operator fun <T> MutableFoo<T>.plus(x: T): MutableFoo<T> = MutableFoo(x)
fun box(): String {
var f = MutableFoo(1)
f += 2
return if (f is MutableFoo && f.value == 2) "OK" else "fail"
}