fun check(expected: String, obj: Any?) { val actual = obj.toString() if (actual != expected) throw AssertionError("Expected: $expected, actual: $actual") } fun box(): String { check("jet.FunctionImpl0") { () : Unit -> } check("jet.FunctionImpl0") { () : Int -> 42 } check("jet.FunctionImpl1") { (s: String) : Long -> 42.toLong() } check("jet.FunctionImpl2") { (x: Int, y: Int) : Unit -> } check("jet.ExtensionFunctionImpl0") { Int.() : Unit -> } check("jet.ExtensionFunctionImpl0") { Unit.() : Int -> 42 } check("jet.ExtensionFunctionImpl1") { String.(s: String) : Long -> 42.toLong() } check("jet.ExtensionFunctionImpl2") { Int.(x: Int, y: Int) : Unit -> } return "OK" }