inline infix fun T.or(orBlock: () → T) = if (this == null) orBlock() else this
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Feature request - guard from Swift | 3 | 1357 | September 22, 2018 | |
|
Not null check
|
9 | 4192 | January 31, 2022 | |
| Support for Groovy style "Power Assertion" in Kotlin? | 15 | 7353 | April 26, 2021 | |
| Extension to ?.let syntax | 7 | 4969 | February 20, 2020 | |
| Supporting a `return if not null` operator | 17 | 25091 | December 30, 2019 |