Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/extensionFunctions/kt865.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

18 lines
328 B
Kotlin

class Template() {
val collected = ArrayList<String>()
operator fun String.unaryPlus() {
collected.add(this@unaryPlus)
}
fun test() {
+ "239"
}
}
fun box() : String {
val u = Template()
u.test()
return if(u.collected.size == 1 && u.collected.get(0) == "239") "OK" else "fail"
}