apatrida
09/30/2015, 4:32 PMfun <T: Any> T?.ifPresent(compute: (T) -> Unit): T? {
if (this != null) compute(this)
return this
}
public fun foo() {
mapOf("to" to "2").get("to").ifPresent compute@ { tagView ->
// I cannot return anoything but Unit because that is what my closure expects
}
}