https://kotlinlang.org logo
e

ean5533

07/01/2016, 8:34 PM
Doesn't compile:
fun error(msg: () -> String): Unit = if (isErrorEnabled) error(msg.invoke())
Compiles:
fun error(msg: () -> String): Unit { if (isErrorEnabled) error(msg.invoke()) }