abf70a586c
Being disabled by default and not well-documented, these functions cause confusion among early adopters as to why their code don't work properly. Assert APIs need a proper design across Kotlin platforms. Since APIs are not available in common code and K/JS, it is premature to have such a general feature in a new experimental platform. Compiler tests: * Mute tests that rely on assert. * Replace JVM-specific assert calls with require calls and unmute passed K/JS tests. Merge-request: KT-MR-8636 Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
19 lines
428 B
Kotlin
Vendored
19 lines
428 B
Kotlin
Vendored
// WITH_STDLIB
|
|
|
|
inline fun<reified T> createArray(n: Int, crossinline block: () -> T): Array<T> {
|
|
return Array<T>(n) { block() }
|
|
}
|
|
|
|
inline fun<T1, T2, T3, T4, T5, T6, reified R> recursive(
|
|
crossinline block: () -> R
|
|
): Array<R> {
|
|
return createArray(5) { block() }
|
|
}
|
|
|
|
fun box(): String {
|
|
val x = recursive<Int, Int, Int, Int, Int, Int, String>(){ "abc" }
|
|
|
|
require(x.all { it == "abc" })
|
|
return "OK"
|
|
}
|