Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/shared.kt
T
2018-06-09 19:15:38 +03:00

15 lines
295 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
infix fun <T> T.mustBe(t : T) {
assert("$this must be $t") {this == t}
}
inline fun assert(message : String, condition : () -> Boolean) {
if (!condition())
throw AssertionError(message)
}
fun box() : String {
"lala" mustBe "lala"
return "OK"
}