Redundant nullable return type: false negative with return expression in local function or lambda

#KT-41817 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-09-11 10:22:32 +09:00
committed by Vladimir Dolzhenko
parent de3907e8cc
commit 370622087b
6 changed files with 42 additions and 3 deletions
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun test(list: List<Int>): Int?<caret> {
val x = list.mapNotNull {
return@mapNotNull null
}
return 1
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun test(list: List<Int>): Int {
val x = list.mapNotNull {
return@mapNotNull null
}
return 1
}
@@ -0,0 +1,6 @@
fun test(): Int?<caret> {
fun f(): Int? {
return null
}
return 1
}
@@ -0,0 +1,6 @@
fun test(): Int {
fun f(): Int? {
return null
}
return 1
}