Can you create a Custom Conditional Expression in Kotlin?
Currently I'm trying to write the equivalent of a custom conditional block or a non-extension version of the takeIf function that carries through things like nullability checks ect... and having difficulty doing so. The motivation behind this is that at my company we have a lot of use cases that look like either
return if (condition) {
// Code block (can often be large enough to distort what the else belongs to at a glance)
} else {
null
}
or something that has...