If then to elvis: no more allowed for if expressions with Unit result

This commit is contained in:
Mikhail Glukhikh
2016-10-27 18:05:03 +03:00
parent 8edd33ee92
commit f3c25c728e
3 changed files with 27 additions and 3 deletions
@@ -0,0 +1,16 @@
// IS_APPLICABLE: false
open class Some {
fun bar() {}
}
object Obj : Some()
fun foo(arg: Any?) {
<caret>if (arg is Some) {
arg.bar()
}
else {
Obj.bar()
}
}