Files
kotlin-fork/js/js.translator/testData/expression/function/cases/infixCall.kt
T
Denis Zharkov 73799e2c3c Replace deprecated lambda syntax in testData
It's done with similar constructions where possible trying to preserve
intended behavior.
Some usages are removed because they test exactly the feature that
we are going to drop soon.
2015-09-25 08:29:25 +03:00

20 lines
361 B
Kotlin
Vendored

// EA-56241
package foo
fun Int.foo(a: Int) = this + a
val bar = fun Int.(a: Int): Int = this * a
fun test(op: Int.(Int) -> Int) = 3 op 20
fun box(): String {
val op = fun Int.(a: Int): Int = this / a
assertEquals(41, 34 foo 7)
assertEquals(28, 4 bar 7)
assertEquals(-17, test { this - it })
assertEquals(7, 49 op 7)
return "OK"
}