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.
14 lines
310 B
Kotlin
Vendored
14 lines
310 B
Kotlin
Vendored
class Point(val x: Int, val y: Int)
|
|
|
|
fun box(): String {
|
|
val answer = apply(Point(3, 5), { scalar: Int ->
|
|
Point(x * scalar, y * scalar)
|
|
})
|
|
|
|
return if (answer.x == 6 && answer.y == 10) "OK" else "FAIL"
|
|
}
|
|
|
|
fun apply(arg: Point, f: Point.(scalar: Int) -> Point): Point {
|
|
return arg.f(2)
|
|
}
|