Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
This commit is contained in:
committed by
Alexander Udalov
parent
54a615fcd3
commit
20e36438e2
@@ -0,0 +1,11 @@
|
||||
operator fun Array<String>.get(index1: Int, index2: Int) = this[index1 + index2]
|
||||
operator fun Array<String>.set(index1: Int, index2: Int, elem: String) {
|
||||
this[index1 + index2] = elem
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val s = Array<String>(1, { "" })
|
||||
s[1, -1] = "O"
|
||||
s[2, -2] += "K"
|
||||
return s[-3, 3]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
operator fun Array<String>.get(index1: Int, index2: Int) = this[index1 + index2]
|
||||
operator fun Array<String>.set(index1: Int, index2: Int, elem: String) {
|
||||
this[index1 + index2] = elem
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val s = Array<String>(1, { "" })
|
||||
s[1, -1] = "OK"
|
||||
return s[-2, 2]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.Arrays.equals
|
||||
|
||||
fun box(): String {
|
||||
val s = arrayOf("live", "long")
|
||||
val t: Array<String> = s.clone()
|
||||
if (!equals(s, t)) return "Fail string"
|
||||
if (s === t) return "Fail string identity"
|
||||
|
||||
val ss = arrayOf(s, s)
|
||||
val tt: Array<Array<String>> = ss.clone()
|
||||
if (!equals(ss, tt)) return "Fail string[]"
|
||||
if (ss === tt) return "Fail string[] identity"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import java.util.Arrays.equals
|
||||
|
||||
fun box(): String {
|
||||
val i = intArrayOf(1, 2)
|
||||
if (!equals(i, i.clone())) return "Fail int"
|
||||
if (i.clone() === i) return "Fail int identity"
|
||||
|
||||
val j = longArrayOf(1L, 2L)
|
||||
if (!equals(j, j.clone())) return "Fail long"
|
||||
if (j.clone() === j) return "Fail long identity"
|
||||
|
||||
val s = shortArrayOf(1.toShort(), 2.toShort())
|
||||
if (!equals(s, s.clone())) return "Fail short"
|
||||
if (s.clone() === s) return "Fail short identity"
|
||||
|
||||
val b = byteArrayOf(1.toByte(), 2.toByte())
|
||||
if (!equals(b, b.clone())) return "Fail byte"
|
||||
if (b.clone() === b) return "Fail byte identity"
|
||||
|
||||
val c = charArrayOf('a', 'b')
|
||||
if (!equals(c, c.clone())) return "Fail char"
|
||||
if (c.clone() === c) return "Fail char identity"
|
||||
|
||||
val d = doubleArrayOf(1.0, -1.0)
|
||||
if (!equals(d, d.clone())) return "Fail double"
|
||||
if (d.clone() === d) return "Fail double identity"
|
||||
|
||||
val f = floatArrayOf(1f, -1f)
|
||||
if (!equals(f, f.clone())) return "Fail float"
|
||||
if (f.clone() === f) return "Fail float identity"
|
||||
|
||||
val z = booleanArrayOf(true, false)
|
||||
if (!equals(z, z.clone())) return "Fail boolean"
|
||||
if (z.clone() === z) return "Fail boolean identity"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun test(y: Array<in Array<String>>) {
|
||||
y[0] = kotlin.arrayOf("OK")
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val x : Array<Array<*>> = kotlin.arrayOf(kotlin.arrayOf(1))
|
||||
test(x)
|
||||
return x[0][0] as String
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fun box(): String {
|
||||
val x : Array<Array<*>> = arrayOf(arrayOf(1))
|
||||
val y : Array<in Array<String>> = x
|
||||
|
||||
if (y.size != 1) return "fail 1"
|
||||
|
||||
y[0] = arrayOf("OK")
|
||||
|
||||
return x[0][0] as String
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
val x = Array<Int>(5, { it } ).iterator()
|
||||
var i = 0
|
||||
while (x.hasNext()) {
|
||||
if (x.next() != i) return "Fail $i"
|
||||
i++
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
var result = 0
|
||||
|
||||
fun <T> Iterator<T>.foreach(action: (T) -> Unit) {
|
||||
while (this.hasNext()) {
|
||||
(action)(this.next())
|
||||
}
|
||||
}
|
||||
|
||||
fun <In, Out> Iterator<In>.select(f: (In) -> Out) : Iterator<Out> {
|
||||
return Selector(this, f);
|
||||
}
|
||||
|
||||
class Selector<In, Out>(val source: Iterator<In>, val f: (In) -> Out) : Iterator<Out> {
|
||||
override fun hasNext(): Boolean = source.hasNext()
|
||||
|
||||
override fun next(): Out {
|
||||
return (f)(source.next())
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Array(4, { it + 1 }).iterator()
|
||||
.select({i -> i * 10})
|
||||
.foreach({k -> result += k})
|
||||
if (result != 10+20+30+40) return "Fail: $result"
|
||||
return "OK"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fun fill(dest : Array<in String>, v : String) {
|
||||
dest[0] = v
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
//fun main(args : Array<String>) {
|
||||
val s : String = "bar"
|
||||
val any : Array<Any> = arrayOf(1, "foo", 1.234)
|
||||
fill(any, s)
|
||||
/* shouldn't throw
|
||||
ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
|
||||
*/
|
||||
return "OK"
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
fun Array<String>.test1(): Array<String> {
|
||||
val func = { i:Int -> this}
|
||||
return func(1)
|
||||
}
|
||||
|
||||
fun Array<String>.test1Nested(): Array<String> {
|
||||
val func = { i: Int -> { this }()}
|
||||
return func(1)
|
||||
}
|
||||
|
||||
|
||||
fun Array<String>.test2() : Array<String> {
|
||||
class Z2() {
|
||||
fun run(): Array<String> {
|
||||
return this@test2
|
||||
}
|
||||
}
|
||||
return Z2().run()
|
||||
}
|
||||
|
||||
fun Array<String>.test2Nested() : Array<String> {
|
||||
class Z2() {
|
||||
fun run(): Array<String> {
|
||||
class Z3 {
|
||||
fun run(): Array<String> {
|
||||
return this@test2Nested;
|
||||
}
|
||||
}
|
||||
return Z3().run()
|
||||
}
|
||||
}
|
||||
return Z2().run()
|
||||
}
|
||||
|
||||
fun Array<String>.test3(): Array<String> {
|
||||
fun local(): Array<String> {
|
||||
return this@test3
|
||||
}
|
||||
return local()
|
||||
}
|
||||
|
||||
fun Array<String>.test3Nested(): Array<String> {
|
||||
fun local(): Array<String> {
|
||||
fun local2(): Array<String> {
|
||||
return this@test3Nested
|
||||
}
|
||||
return local2()
|
||||
}
|
||||
return local()
|
||||
}
|
||||
|
||||
|
||||
fun Array<String>.test4() : Array<String> {
|
||||
return object {
|
||||
fun run() : Array<String> {
|
||||
return this@test4
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
|
||||
fun Array<String>.test4Nested() : Array<String> {
|
||||
return object {
|
||||
fun run() : Array<String> {
|
||||
return object {
|
||||
fun run() : Array<String> {
|
||||
return this@test4Nested
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
|
||||
fun Array<DoubleArray>.test1(): Array<DoubleArray> {
|
||||
val func = { i: Int -> this}
|
||||
return func(1)
|
||||
}
|
||||
|
||||
|
||||
fun box() : String {
|
||||
val array = Array<String>(2, { i -> "${i}" })
|
||||
if (array != array.test1()) return "fail 1"
|
||||
if (array != array.test2()) return "fail 2"
|
||||
if (array != array.test3()) return "fail 3"
|
||||
if (array != array.test4()) return "fail 4"
|
||||
|
||||
if (array != array.test1Nested()) return "fail 1Nested"
|
||||
if (array != array.test2Nested()) return "fail 2Nested"
|
||||
if (array != array.test3Nested()) return "fail 3Nested"
|
||||
if (array != array.test4Nested()) return "fail 4Nested"
|
||||
|
||||
val array2 = Array<DoubleArray>(2, { i -> DoubleArray(i) })
|
||||
if (array2 != array2.test1()) return "fail on array of double []"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun box(): String {
|
||||
val array = intArrayOf(11, 12, 13)
|
||||
val p = array.get(0)
|
||||
if (p != 11) return "fail 1: $p"
|
||||
|
||||
val stringArray = arrayOf("OK", "FAIL")
|
||||
return stringArray.get(0)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box() : String {
|
||||
val data = Array<Array<Boolean>>(3) { Array<Boolean>(4, {false}) }
|
||||
for(d in data) {
|
||||
if(d.size != 4) return "fail"
|
||||
for(b in d) if (b) return "fail"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
class C(val i: Int) {
|
||||
operator fun component1() = i + 1
|
||||
operator fun component2() = i + 2
|
||||
}
|
||||
|
||||
fun doTest(l : Array<C>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<C>(3, {x -> C(x)})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class C(val i: Int) {
|
||||
}
|
||||
|
||||
operator fun C.component1() = i + 1
|
||||
operator fun C.component2() = i + 2
|
||||
|
||||
fun doTest(l : Array<C>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<C>(3, {x -> C(x)})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
class C(val i: Int) {
|
||||
}
|
||||
|
||||
class M {
|
||||
operator fun C.component1() = i + 1
|
||||
operator fun C.component2() = i + 2
|
||||
|
||||
fun doTest(l : Array<C>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<C>(3, {x -> C(x)})
|
||||
val s = M().doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
class C(val i: Int) {
|
||||
}
|
||||
|
||||
class M {
|
||||
operator fun C.component1() = i + 1
|
||||
operator fun C.component2() = i + 2
|
||||
}
|
||||
|
||||
fun M.doTest(l : Array<C>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<C>(3, {x -> C(x)})
|
||||
val s = M().doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
class C(val i: Int) {
|
||||
operator fun component1() = i + 1
|
||||
operator fun component2() = i + 2
|
||||
}
|
||||
|
||||
fun doTest(l : Array<C>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += {"$a:$b;"}()
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<C>(3, {x -> C(x)})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
operator fun Int.component1() = this + 1
|
||||
operator fun Int.component2() = this + 2
|
||||
|
||||
fun doTest(l : Array<Int>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Int>(3, {x -> x})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
operator fun Int.component1() = this + 1
|
||||
operator fun Int.component2() = this + 2
|
||||
|
||||
fun doTest(l : Array<Int>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += {"$a:$b;"}()
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Int>(3, {x -> x})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
class M {
|
||||
operator fun Int.component1() = this + 1
|
||||
operator fun Int.component2() = this + 2
|
||||
|
||||
fun doTest(l : Array<Int>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Int>(3, {x -> x})
|
||||
val s = M().doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
class M {
|
||||
operator fun Int.component1() = this + 1
|
||||
operator fun Int.component2() = this + 2
|
||||
}
|
||||
|
||||
fun M.doTest(l : Array<Int>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Int>(3, {x -> x})
|
||||
val s = M().doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
fun doTest(l : Array<Long>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Long>(3, {x -> x.toLong()})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
fun doTest(l : Array<Long>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += {"$a:$b;"}()
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Long>(3, {x -> x.toLong()})
|
||||
val s = doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
|
||||
fun doTest(l : Array<Long>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Long>(3, {x -> x.toLong()})
|
||||
val s = M().doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
class M {
|
||||
operator fun Long.component1() = this + 1
|
||||
operator fun Long.component2() = this + 2
|
||||
}
|
||||
|
||||
fun M.doTest(l : Array<Long>): String {
|
||||
var s = ""
|
||||
for ((a, b) in l) {
|
||||
s += "$a:$b;"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val l = Array<Long>(3, {x -> x.toLong()})
|
||||
val s = M().doTest(l)
|
||||
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
fun testArray() {
|
||||
Array<String>(5) { i ->
|
||||
if (i == 3) return
|
||||
i.toString()
|
||||
}
|
||||
throw AssertionError()
|
||||
}
|
||||
|
||||
fun testIntArray() {
|
||||
IntArray(5) { i ->
|
||||
if (i == 3) return
|
||||
i
|
||||
}
|
||||
throw AssertionError()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
testArray()
|
||||
testIntArray()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class A() {
|
||||
class B(val i: Int) {
|
||||
}
|
||||
|
||||
fun test() = Array<B> (10, { B(it) })
|
||||
}
|
||||
|
||||
fun box() = if(A().test()[5].i == 5) "OK" else "fail"
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
interface ISized {
|
||||
val size : Int
|
||||
}
|
||||
|
||||
interface javaUtilIterator<T> : Iterator<T> {
|
||||
fun remove() : Unit {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
class MyIterator<T>(val array : ReadOnlyArray<T>) : javaUtilIterator<T> {
|
||||
private var index = 0
|
||||
|
||||
override fun hasNext() : Boolean = index < array.size
|
||||
|
||||
override fun next() : T = array.get(index++)
|
||||
}
|
||||
|
||||
interface ReadOnlyArray<out T> : ISized, Iterable<T> {
|
||||
operator fun get(index : Int) : T
|
||||
|
||||
override fun iterator() : Iterator<T> = MyIterator<T>(this)
|
||||
}
|
||||
|
||||
interface WriteOnlyArray<in T> : ISized {
|
||||
operator fun set(index : Int, value : T) : Unit
|
||||
|
||||
operator fun set(from: Int, count: Int, value: T) {
|
||||
for(i in from..from+count-1) {
|
||||
set(i, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MutableArray<T>(length: Int, init : (Int) -> T) : ReadOnlyArray<T>, WriteOnlyArray<T> {
|
||||
private val array = Array<Any?>(length, init)
|
||||
|
||||
override fun get(index : Int) : T = array[index] as T
|
||||
override fun set(index : Int, value : T) : Unit { array[index] = value }
|
||||
|
||||
override val size : Int
|
||||
get() = array.size
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
var a = MutableArray<Int> (4, {0})
|
||||
a [0] = 10
|
||||
a.set(1, 2, 13)
|
||||
a [3] = 40
|
||||
a.iterator()
|
||||
a.iterator().hasNext()
|
||||
for(el in a) {
|
||||
val fl = el
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun box() : String {
|
||||
try {
|
||||
return "OK"
|
||||
}
|
||||
finally {
|
||||
null?.toString()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fun box() : String {
|
||||
val s = "notA"
|
||||
val id = when (s) {
|
||||
"a" -> 1
|
||||
else -> null
|
||||
}
|
||||
|
||||
if (id == null) return "OK"
|
||||
return "fail"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
abstract class A {
|
||||
abstract fun foo(): String
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
override fun foo() = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = (A::foo)(B())
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun box(): String {
|
||||
if ((Boolean::not)(true) != false) return "Fail 1"
|
||||
if ((Boolean::not)(false) != true) return "Fail 2"
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
fun foo(k: Int) = k
|
||||
|
||||
fun result() = (A::foo)(this, 111)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = A().result()
|
||||
if (result != 111) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
fun o() = 111
|
||||
fun k(k: Int) = k
|
||||
}
|
||||
|
||||
fun A.foo() = (A::o)(this) + (A::k)(this, 222)
|
||||
|
||||
fun box(): String {
|
||||
val result = A().foo()
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
fun foo() = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = A::foo
|
||||
return x(A())
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
fun foo(result: String) = result
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = A::foo
|
||||
return x(A(), "OK")
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
var result = "Fail"
|
||||
|
||||
fun foo() {
|
||||
result = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
val x = A::foo
|
||||
x(a)
|
||||
return a.result
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
var result = "Fail"
|
||||
|
||||
fun foo(newResult: String) {
|
||||
result = newResult
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
val x = A::foo
|
||||
x(a, "OK")
|
||||
return a.result
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
var result = "OK"
|
||||
}
|
||||
|
||||
fun box() = (::A)().result
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
class A(val result: String)
|
||||
|
||||
fun box() = (::A)("OK").result
|
||||
@@ -0,0 +1,9 @@
|
||||
enum class E {
|
||||
ENTRY
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val f = E::valueOf
|
||||
val result = f("ENTRY")
|
||||
return if (result == E.ENTRY) "OK" else "Fail $result"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class A
|
||||
|
||||
fun box() = if ((A::equals)(A(), A())) "Fail" else "OK"
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
fun result() = (A::foo)(this, "OK")
|
||||
}
|
||||
|
||||
fun A.foo(x: String) = x
|
||||
|
||||
fun box() = A().result()
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A
|
||||
|
||||
fun A.foo() = (A::bar)(this, "OK")
|
||||
|
||||
fun A.bar(x: String) = x
|
||||
|
||||
fun box() = A().foo()
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
class A
|
||||
|
||||
fun A.foo() = "OK"
|
||||
|
||||
fun box(): String {
|
||||
val x = A::foo
|
||||
return x(A())
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
class A
|
||||
|
||||
fun A.foo(result: String) = result
|
||||
|
||||
fun box(): String {
|
||||
val x = A::foo
|
||||
return x(A(), "OK")
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
var result = "Fail"
|
||||
}
|
||||
|
||||
fun A.foo() {
|
||||
result = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
val x = A::foo
|
||||
x(a)
|
||||
return a.result
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
var result = "Fail"
|
||||
}
|
||||
|
||||
fun A.foo(newResult: String) {
|
||||
result = newResult
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
val x = A::foo
|
||||
x(a, "OK")
|
||||
return a.result
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class A<T>(val t: T) {
|
||||
fun foo(): T = t
|
||||
}
|
||||
|
||||
fun box() = (A<String>::foo)(A("OK"))
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
inner class Inner {
|
||||
val o = 111
|
||||
val k = 222
|
||||
}
|
||||
|
||||
fun result() = (A::Inner)(this).o + (A::Inner)(this).k
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = A().result()
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
inner class Inner {
|
||||
val o = 111
|
||||
val k = 222
|
||||
}
|
||||
}
|
||||
|
||||
fun A.foo() = (A::Inner)(this).o + (A::Inner)(this).k
|
||||
|
||||
fun box(): String {
|
||||
val result = A().foo()
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
inner class Inner {
|
||||
val o = 111
|
||||
val k = 222
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = (A::Inner)((::A)()).o + (A::Inner)(A()).k
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelOneStringArg.kt
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
inner class Inner(val result: Int)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = (A::Inner)((::A)(), 111).result + (A::Inner)(A(), 222).result
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// KT-5123
|
||||
|
||||
import java.util.Collections
|
||||
import java.util.ArrayList
|
||||
|
||||
fun box(): String {
|
||||
val numbers = ArrayList<Int>()
|
||||
numbers.add(1)
|
||||
numbers.add(2)
|
||||
numbers.add(3)
|
||||
(Collections::rotate)(numbers, 1)
|
||||
return if ("$numbers" == "[3, 1, 2]") "OK" else "Fail $numbers"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class Outer {
|
||||
val result = "OK"
|
||||
|
||||
inner class Inner {
|
||||
fun foo() = result
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val f = Outer.Inner::foo
|
||||
return f(Outer().Inner())
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun box(): String {
|
||||
class Local {
|
||||
fun foo() = "OK"
|
||||
}
|
||||
|
||||
val ref = Local::foo
|
||||
return ref(Local())
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
var result = "Fail"
|
||||
|
||||
fun changeToOK() { result = "OK" }
|
||||
|
||||
val ok = ::changeToOK
|
||||
ok()
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
class A {
|
||||
val result = "OK"
|
||||
}
|
||||
|
||||
return (::A)().result
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
fun box(): String {
|
||||
class A {
|
||||
var result: String = "Fail";
|
||||
init {
|
||||
result = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
return (::A)().result
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface Named {
|
||||
val name: String
|
||||
}
|
||||
|
||||
enum class E : Named {
|
||||
OK
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return E.OK.name
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A
|
||||
|
||||
fun box(): String {
|
||||
fun A.foo() = "OK"
|
||||
return (A::foo)(A())
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun box(): String {
|
||||
class A
|
||||
fun A.foo() = "OK"
|
||||
return (A::foo)((::A)())
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun box(): String {
|
||||
fun Int.is42With(that: Int) = this + 2 * that == 42
|
||||
return if ((Int::is42With)(16, 13)) "OK" else "Fail"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class A
|
||||
|
||||
fun box(): String {
|
||||
var result = "Fail"
|
||||
|
||||
fun A.ext() { result = "OK" }
|
||||
|
||||
val f = A::ext
|
||||
f(A())
|
||||
return result
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun box(): String {
|
||||
class Id<T> {
|
||||
fun invoke(t: T) = t
|
||||
}
|
||||
|
||||
val ref = Id<String>::invoke
|
||||
return ref(Id<String>(), "OK")
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun box(): String {
|
||||
val result = "OK"
|
||||
|
||||
class Local {
|
||||
fun foo() = result
|
||||
}
|
||||
|
||||
val member = Local::foo
|
||||
val instance = Local()
|
||||
return member(instance)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fun box(): String {
|
||||
fun foo(): String {
|
||||
fun bar() = "OK"
|
||||
val ref = ::bar
|
||||
return ref()
|
||||
}
|
||||
|
||||
val ref = ::foo
|
||||
return ref()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun foo(until: Int): String {
|
||||
fun bar(x: Int): String =
|
||||
if (x == until) "OK" else bar(x + 1)
|
||||
return (::bar)(0)
|
||||
}
|
||||
|
||||
fun box() = foo(10)
|
||||
@@ -0,0 +1,4 @@
|
||||
fun box(): String {
|
||||
fun foo() = "OK"
|
||||
return (::foo)()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
val result = "OK"
|
||||
|
||||
fun foo() = result
|
||||
|
||||
return (::foo)()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun box(): String {
|
||||
fun foo(s: String) = s
|
||||
return (::foo)("OK")
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
var state = 23
|
||||
|
||||
fun box(): String {
|
||||
fun incrementState(inc: Int) {
|
||||
state += inc
|
||||
}
|
||||
|
||||
val inc = ::incrementState
|
||||
inc(12)
|
||||
inc(-5)
|
||||
inc(27)
|
||||
inc(-15)
|
||||
|
||||
return if (state == 42) "OK" else "Fail $state"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
class Nested {
|
||||
val o = 111
|
||||
val k = 222
|
||||
}
|
||||
|
||||
fun result() = (::Nested)().o + (A::Nested)().k
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = A().result()
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
class Nested {
|
||||
val result = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = (A::Nested)().result
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
class Nested(val result: String)
|
||||
}
|
||||
|
||||
fun box() = (A::Nested)("OK").result
|
||||
@@ -0,0 +1,13 @@
|
||||
private fun <T> upcast(value: T): T = value
|
||||
|
||||
fun box(): String {
|
||||
upcast<(Int)->ByteArray>(::ByteArray)(10)
|
||||
upcast<(Int)->IntArray>(::IntArray)(10)
|
||||
upcast<(Int)->ShortArray>(::ShortArray)(10)
|
||||
upcast<(Int)->LongArray>(::LongArray)(10)
|
||||
upcast<(Int)->DoubleArray>(::DoubleArray)(10)
|
||||
upcast<(Int)->FloatArray>(::FloatArray)(10)
|
||||
upcast<(Int)->BooleanArray>(::BooleanArray)(10)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
fun foo(): String = "foo1"
|
||||
fun foo(i: Int): String = "foo2"
|
||||
|
||||
val f1: () -> String = ::foo
|
||||
val f2: (Int) -> String = ::foo
|
||||
|
||||
fun foo1() {}
|
||||
fun foo2(i: Int) {}
|
||||
|
||||
fun bar(f: () -> Unit): String = "bar1"
|
||||
fun bar(f: (Int) -> Unit): String = "bar2"
|
||||
|
||||
fun box(): String {
|
||||
val x1 = f1()
|
||||
if (x1 != "foo1") return "Fail 1: $x1"
|
||||
|
||||
val x2 = f2(0)
|
||||
if (x2 != "foo2") return "Fail 2: $x2"
|
||||
|
||||
val y1 = bar(::foo1)
|
||||
if (y1 != "bar1") return "Fail 3: $y1"
|
||||
|
||||
val y2 = bar(::foo2)
|
||||
if (y2 != "bar2") return "Fail 4: $y2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
val x = 1
|
||||
fun x(): String = "OK"
|
||||
}
|
||||
|
||||
val f1: KProperty1<A, Int> = A::x
|
||||
val f2: (A) -> String = A::x
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
|
||||
val x1 = f1.get(a)
|
||||
if (x1 != 1) return "Fail 1: $x1"
|
||||
|
||||
return f2(a)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
private fun foo() = "OK"
|
||||
|
||||
fun bar() = (A::foo)(this)
|
||||
}
|
||||
|
||||
fun box() = A().bar()
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import java.util.ArrayList
|
||||
import java.util.Arrays
|
||||
import java.util.Collections
|
||||
import java.util.Comparator
|
||||
|
||||
fun sort(list: MutableList<String>, comparator: (String, String) -> Int) {
|
||||
Collections.sort(list, object : Comparator<String> {
|
||||
override fun compare(p0: String, p1: String) = comparator(p0, p1)
|
||||
})
|
||||
}
|
||||
|
||||
fun compare(s1: String, s2: String) = s1.compareTo(s2)
|
||||
|
||||
fun box(): String {
|
||||
val l = ArrayList(Arrays.asList("d", "b", "c", "e", "a"))
|
||||
sort(l, ::compare)
|
||||
if (l != Arrays.asList("a", "b", "c", "d", "e")) return "Fail: $l"
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun foo(o: Int, k: Int) = o + k
|
||||
|
||||
class A {
|
||||
fun bar() = (::foo)(111, 222)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = A().bar()
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun foo(o: Int, k: Int) = o + k
|
||||
|
||||
class A
|
||||
|
||||
fun A.bar() = (::foo)(111, 222)
|
||||
|
||||
fun box(): String {
|
||||
val result = A().bar()
|
||||
if (result != 333) return "Fail $result"
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
fun foo() = "OK"
|
||||
|
||||
fun box(): String {
|
||||
val x = ::foo
|
||||
return x()
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
fun foo(x: String) = x
|
||||
|
||||
fun box(): String {
|
||||
val x = ::foo
|
||||
return x("OK")
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
var result = "Fail"
|
||||
|
||||
fun foo() {
|
||||
result = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = ::foo
|
||||
x()
|
||||
return result
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
var result = "Fail"
|
||||
|
||||
fun foo(newResult: String) {
|
||||
result = newResult
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = ::foo
|
||||
x("OK")
|
||||
return result
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
interface T {
|
||||
fun foo() = "OK"
|
||||
}
|
||||
|
||||
class B : T {
|
||||
inner class C {
|
||||
fun bar() = (T::foo)(this@B)
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = B().C().bar()
|
||||
@@ -0,0 +1,9 @@
|
||||
interface A {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
class B : A {
|
||||
override fun foo() = "OK"
|
||||
}
|
||||
|
||||
fun box() = (A::foo)(B())
|
||||
@@ -0,0 +1,9 @@
|
||||
abstract class Base {
|
||||
val result = "OK"
|
||||
}
|
||||
|
||||
class Derived : Base()
|
||||
|
||||
fun box(): String {
|
||||
return (Base::result).get(Derived())
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val four: Int by NumberDecrypter
|
||||
|
||||
class A {
|
||||
val two: Int by NumberDecrypter
|
||||
}
|
||||
|
||||
object NumberDecrypter {
|
||||
operator fun getValue(instance: Any?, data: KProperty<*>) = when (data.name) {
|
||||
"four" -> 4
|
||||
"two" -> 2
|
||||
else -> throw AssertionError()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = ::four.get()
|
||||
if (x != 4) return "Fail x: $x"
|
||||
val a = A()
|
||||
val y = A::two.get(a)
|
||||
if (y != 2) return "Fail y: $y"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
var result: String by Delegate
|
||||
|
||||
object Delegate {
|
||||
var value = "lol"
|
||||
|
||||
operator fun getValue(instance: Any?, data: KProperty<*>): String {
|
||||
return value
|
||||
}
|
||||
|
||||
operator fun setValue(instance: Any?, data: KProperty<*>, newValue: String) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val f = ::result
|
||||
if (f.get() != "lol") return "Fail 1: {$f.get()}"
|
||||
Delegate.value = "rofl"
|
||||
if (f.get() != "rofl") return "Fail 2: {$f.get()}"
|
||||
f.set("OK")
|
||||
return f.get()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
enum class E {
|
||||
I
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val i = (E::name).get(E.I)
|
||||
if (i != "I") return "Fail $i"
|
||||
val n = (E::ordinal).get(E.I)
|
||||
if (n != 0) return "Fail $n"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
val Array<String>.firstElement: String get() = get(0)
|
||||
|
||||
fun box(): String {
|
||||
val p = Array<String>::firstElement
|
||||
return p.get(arrayOf("OK", "Fail"))
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//For KT-6020
|
||||
import kotlin.reflect.KProperty1
|
||||
import kotlin.reflect.KMutableProperty1
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Value<T>(var value: T = null as T, var text: String? = null)
|
||||
|
||||
val <T> Value<T>.additionalText by DVal(Value<T>::text) //works
|
||||
|
||||
val <T> Value<T>.additionalValue by DVal(Value<T>::value) //not work
|
||||
|
||||
class DVal<T, R, P: KProperty1<T, R>>(val kmember: P) {
|
||||
operator fun getValue(t: T, p: KProperty<*>): R {
|
||||
return kmember.get(t)
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val p = Value("O", "K")
|
||||
return p.additionalValue + p.additionalText
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
var state = ""
|
||||
|
||||
var topLevel: Int
|
||||
get() {
|
||||
state += "1"
|
||||
return 42
|
||||
}
|
||||
set(value) {
|
||||
throw AssertionError("Nooo")
|
||||
}
|
||||
|
||||
class A {
|
||||
val member: String
|
||||
get() {
|
||||
state += "2"
|
||||
return "42"
|
||||
}
|
||||
}
|
||||
|
||||
val A.ext: Any
|
||||
get() {
|
||||
state += "3"
|
||||
return this
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
(::topLevel)()
|
||||
(A::member)(A())
|
||||
(A::ext)(A())
|
||||
return if (state == "123") "OK" else "Fail $state"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// Name of the getter should be 'getaBcde' according to JavaBean conventions
|
||||
var aBcde: Int = 239
|
||||
|
||||
fun box(): String {
|
||||
val x = (::aBcde).get()
|
||||
if (x != 239) return "Fail x: $x"
|
||||
|
||||
(::aBcde).set(42)
|
||||
|
||||
val y = (::aBcde).get()
|
||||
if (y != 42) return "Fail y: $y"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import kotlin.reflect.KProperty1
|
||||
|
||||
class A {
|
||||
companion object {
|
||||
val ref: KProperty1<A, String> = A::foo
|
||||
}
|
||||
|
||||
val foo: String = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.ref.get(A())
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
class Test {
|
||||
private var iv = 1
|
||||
|
||||
public fun exec() {
|
||||
val t = object : Thread() {
|
||||
override fun run() {
|
||||
Test::iv.get(this@Test)
|
||||
Test::iv.set(this@Test, 2)
|
||||
}
|
||||
}
|
||||
t.start()
|
||||
t.join(1000)
|
||||
}
|
||||
|
||||
fun result() = if (iv == 2) "OK" else "Fail $iv"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val t = Test()
|
||||
t.exec()
|
||||
return t.result()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
class Local {
|
||||
var result = "Fail"
|
||||
}
|
||||
|
||||
val l = Local()
|
||||
(Local::result).set(l, "OK")
|
||||
return (Local::result).get(l)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
open class Base {
|
||||
open val foo = "Base"
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
override val foo = "OK"
|
||||
}
|
||||
|
||||
fun box() = (Base::foo).get(Derived())
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user