angryziber / kotlin-puzzlers

A collection of Kotlin Puzzlers
422 stars 58 forks source link

It crushed my production #21

Closed a-dminator closed 7 years ago

a-dminator commented 7 years ago

private fun foo(one: (String) -> Unit = {}, two: (String) -> Unit = {}) { one("one") two("two") }

fun main(args: Array) { foo({ print(it)} ) foo { print(it)} }

// What will it print? // a). oneone // b). twotwo // c). onetwo // d). Will not compile

angryziber commented 7 years ago

A good one, thanks!