JS: move more test to box tests
This commit is contained in:
Vendored
+16
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user