If then to elvis: handle nullability even with implicit receiver

So #KT-22741 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-04-19 10:55:10 +03:00
parent 49165bdbef
commit 8f0c53d0de
3 changed files with 25 additions and 8 deletions
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
class Something {
fun nullable(): Int? = null
}
fun Something?.nullable(value: Int): Int? =
<caret>if (this == null) value else nullable()