This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <A, B, C, R> multiReceiver(f: A.() -> B.() -> C.() -> R) = { a: A, b: B, c: C -> f(a)(b)(c) } | |
val sample1: (X, Y, Z) -> Int = multiReceiver { { { x + y + z } } } | |
val sample2: X.() -> Y.() -> Z.() -> Int = { { { x + y + z } } } | |
class X(val x: Int) | |
class Y(val y: Int) | |
class Z(val z: Int) | |
fun main() { |