mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
14 lines
280 B
Kotlin
Vendored
14 lines
280 B
Kotlin
Vendored
class TestClass {
|
|
companion object {
|
|
inline operator fun <T> invoke(task: () -> T) = task()
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val test1 = TestClass { "K" }
|
|
if (test1 != "K") return "fail1, 'test1' == $test1"
|
|
|
|
val ok = "OK"
|
|
|
|
val x = TestClass { return ok }
|
|
} |