73799e2c3c
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.
20 lines
386 B
Kotlin
Vendored
20 lines
386 B
Kotlin
Vendored
// EA-56241
|
|
package foo
|
|
|
|
class A(val v: Int)
|
|
|
|
val times: A.(Int) -> Int = { a -> this.v * a }
|
|
|
|
fun test(div: A.(Int) -> Int) = A(20) / 4
|
|
|
|
fun box(): String {
|
|
val compareTo: A.(A) -> Int = { a: A -> this.v - a.v }
|
|
|
|
assertEquals(28, A(4) * 7)
|
|
assertEquals(5, test { this.v / it })
|
|
assertEquals(false, A(49) <= A(7))
|
|
assertEquals(true, A(5) > A(1))
|
|
|
|
return "OK"
|
|
}
|