fun check(expected: String, obj: Any?) { val actual = obj.toString() if (actual != expected) throw AssertionError("Expected: $expected, actual: $actual") } fun box(): String { check("kotlin.Function0") { -> } check("kotlin.Function0") { -> 42 } check("kotlin.Function1", fun (s: String) = 42.toLong()) check("kotlin.Function2") { x: Int, y: Int -> } check("kotlin.ExtensionFunction0", fun Int.() {}) check("kotlin.ExtensionFunction0", fun Unit.(): Int = 42) check("kotlin.ExtensionFunction1", fun String.(s: String): Long = 42.toLong()) check("kotlin.ExtensionFunction2", fun Int.(x: Int, y: Int) {}) return "OK" }