c3b97e0668
Get rid of all classes except kotlin.reflect.KFunction, which will be used to represent all kinds of simple functions. Lots of changes to test data are related to the fact that KFunction is not an extension function (as opposed to KMemberFunction and KExtensionFunction who were) and so a member or an extension function reference now requires all arguments be passed to it in the parentheses, including receivers. This is probably temporary until we support calling any function both as a free function and as an extension. In JS, functions and extension functions are not interchangeable, so tests on this behavior are removed until this is supported
43 lines
755 B
Kotlin
Vendored
43 lines
755 B
Kotlin
Vendored
import kotlin.platform.platformStatic
|
|
|
|
object A {
|
|
|
|
val b: String = "OK"
|
|
|
|
platformStatic val c: String = "OK"
|
|
|
|
platformStatic fun test1() : String {
|
|
return b
|
|
}
|
|
|
|
platformStatic fun test2() : String {
|
|
return test1()
|
|
}
|
|
|
|
fun test3(): String {
|
|
return "1".test5()
|
|
}
|
|
|
|
platformStatic fun test4(): String {
|
|
return "1".test5()
|
|
}
|
|
|
|
platformStatic fun String.test5() : String {
|
|
return this + b
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
if ((A::test1)(A) != "OK") return "fail 1"
|
|
|
|
if ((A::test2)(A) != "OK") return "fail 2"
|
|
|
|
if ((A::test3)(A) != "1OK") return "fail 3"
|
|
|
|
if ((A::test4)(A) != "1OK") return "fail 4"
|
|
|
|
if (((A::c).get(A)) != "OK") return "fail 5"
|
|
|
|
return "OK"
|
|
}
|