This patch makes toIndex parameter exclusive in sortArrayWith method
in order to make this method corresponding to the other ones (e.g.
copyOfRange, Array.sortWith extension etc).
It also improves the external sortBy test in order to use it with
different sort algorithms.
This patch updates the test execution harness to work with the
new stdlib tests. It allows one to execute stdlib tests as
a part of external testing (./gradlew run_external) or separately
(./gradlew run_external -Pprefix=external_stdlib).
This patch copies Kotlin/JVM stdlib tests (libraries/stdlib/test)
excepting ones with explicit java dependencies. It also transforms
the tests to use them as box-tests.
1. Containing declaration can be computed as parent from the IR.
2. Sometimes we need to substitute FunctionDescriptor which is defined
inside an inline function call but nevertheless leaks to the outside:
public inline fun <T, R> T.myLet(f: (T) -> R): R = f(this)
interface foo {
fun bar(): String
}
fun box(): String {
val baz = "OK".myLet {
object : foo {
override fun bar() = it
}
}
return baz.bar()
}