9dd8eda1c9
Library methods such as 'listOf' are resolved to have the package fragments as their parents, but JVM expects their containing file classes as parents. This fix generates those file classes and uses them as parent replacements for such library methods.
32 lines
706 B
Kotlin
Vendored
32 lines
706 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
var order = StringBuilder()
|
|
|
|
inline fun expectOrder(at: String, expected: String, body: () -> Unit) {
|
|
order = StringBuilder() // have to do that in order to run this test in JS
|
|
body()
|
|
if (order.toString() != expected) throw AssertionError("$at: expected: $expected, actual: $order")
|
|
}
|
|
|
|
fun low(i: Int): Int {
|
|
order.append("L")
|
|
return i
|
|
}
|
|
|
|
fun high(i: Int): Int {
|
|
order.append("H")
|
|
return i
|
|
}
|
|
|
|
fun x(i: Int): Int {
|
|
order.append("X")
|
|
return i
|
|
}
|
|
|
|
fun box(): String {
|
|
expectOrder("0 in 1 .. 3", "HLX") { x(0) in high(3) downTo low(1) }
|
|
expectOrder("0 !in 1 .. 3", "HLX") { x(0) !in high(3) downTo low(1) }
|
|
|
|
return "OK"
|
|
} |