Support for Groovy style "Power Assertion" in Kotlin?

Does this seem like it could work for you?

inline infix fun <T> T.or(orBlock: () -> T) = if (this == null) orBlock() else this

Here’s an example:

val a: String? = null
val realA = a or {
    "b" // imagine we actually did work instead
}
println(realA) // prints out "b"