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") { () : Unit -> } check("kotlin.Function0") { () : Int -> 42 } check("kotlin.Function1") { (s: String) : Long -> 42.toLong() } check("kotlin.Function2") { (x: Int, y: Int) : Unit -> } check("kotlin.ExtensionFunction0") { Int.() : Unit -> } check("kotlin.ExtensionFunction0") { Unit.() : Int -> 42 } check("kotlin.ExtensionFunction1") { String.(s: String) : Long -> 42.toLong() } check("kotlin.ExtensionFunction2") { Int.(x: Int, y: Int) : Unit -> } return "OK" }