// TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS fun check(expected: String, obj: Any?) { val actual = obj.toString() if (actual != expected) throw AssertionError("Expected: $expected, actual: $actual") } fun box(): String { check("Function0") { -> } check("Function0") { -> 42 } check("Function1", fun (s: String) = 42.toLong()) check("Function2") { x: Int, y: Int -> } check("Function1", fun Int.() {}) check("Function1", fun Unit.(): Int? = 42) check("Function2", fun String.(s: String?): Long = 42.toLong()) check("Function3, java.util.Set, ?, kotlin.Unit>", fun List.(x: MutableSet<*>, y: Nothing) {}) check("Function8", fun (ia: IntArray, ba: ByteArray, sa: ShortArray, ca: CharArray, la: LongArray, za: BooleanArray, fa: FloatArray, da: DoubleArray): Array = null!!) check("Function1[][][], java.lang.Comparable>", fun (a: Array>>>): Comparable = null!!) return "OK" }