This patch replaces ArrayList.removeAll implementation with a
faster one. It also adds the AbstractMutableCollection class
containing default implementations for addAll, removeAll and
retainAll methods and fixes tests to check if removeAll removes
all occurrences found or not.
Some sort tests had an order of equal objects in a sorted list
hardcoded. It caused failures because an approach to placing
equal objects differs in Kotlin JVM and Kotlin Native sort
implementations. With this patch we check if all objects in a list
are sorted istead of checking an exact order of them.
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()
}