Files
kotlin-fork/js/js.translator/testData/box/expression/invoke/invokeMethod.kt
T
2016-09-29 12:00:40 +03:00

14 lines
243 B
Kotlin
Vendored

package foo
class Foo(val postfix: String) {
operator fun invoke(text: String): String {
return text + postfix
}
}
fun box(): String {
val a = Foo(" world!")
assertEquals("hello world!", a("hello"))
return "OK"
}