Redundant nullable return type: fix false positive with non-local return
#KT-41800 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
349cad7b9a
commit
de3907e8cc
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
class MyClass
|
||||
|
||||
inline fun <T> acceptMyClass(m: (MyClass?) -> T) {}
|
||||
|
||||
fun one(): MyClass?<caret> {
|
||||
acceptMyClass { return it }
|
||||
return MyClass()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(str: String): String?<caret> = str.run {
|
||||
return null
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
val test: Int?<caret>
|
||||
get() = run {
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user