angryziber / kotlin-puzzlers

A collection of Kotlin Puzzlers
419 stars 58 forks source link

Smart tailrec #58

Closed rpuxa closed 4 years ago

rpuxa commented 5 years ago
fun main() {
    recursive()
}

tailrec fun recursive() {
    ::recursive()
}

1) Infinite loop 2) StackOverflowError 3) Will not compile 4) Something else

Correct answer: 3. Because foo::baz(args) syntax is reserved for future use