Redundant nullable return type: fix false positive with elvis return

#KT-41878 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-09-14 23:06:17 +02:00
committed by Vladimir Dolzhenko
parent 51d405e950
commit 0e4bd70c29
4 changed files with 42 additions and 6 deletions
@@ -0,0 +1,5 @@
// PROBLEM: none
fun elvisFun(str: String?): String?<caret> {
val v = str?.length ?: return null
return v.toString()
}
@@ -0,0 +1,8 @@
// PROBLEM: none
val foo: String?<caret>
get() {
val s = bar() ?: return null
return s
}
fun bar(): String? = null