Redundant nullable return type: false negative with return expression in local function or lambda
#KT-41817 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
de3907e8cc
commit
370622087b
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<Int>): Int?<caret> {
|
||||
val x = list.mapNotNull {
|
||||
return@mapNotNull null
|
||||
}
|
||||
return 1
|
||||
}
|
||||
idea/testData/inspectionsLocal/redundantNullableReturnType/function/returnNullableForLambda.kt.after
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<Int>): Int {
|
||||
val x = list.mapNotNull {
|
||||
return@mapNotNull null
|
||||
}
|
||||
return 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun test(): Int?<caret> {
|
||||
fun f(): Int? {
|
||||
return null
|
||||
}
|
||||
return 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun test(): Int {
|
||||
fun f(): Int? {
|
||||
return null
|
||||
}
|
||||
return 1
|
||||
}
|
||||
Reference in New Issue
Block a user