New J2K: add support of lambda expressions in nullabilityAnalysis
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
fun notNullParameters(f: Function2<Int, Int, String>) {}
|
||||
fun nullableParameter(f: Function2<Int, Int, String>) {}
|
||||
fun nullableReturnType(f: Function2<Int, Int, String>) {}
|
||||
|
||||
|
||||
fun test() {
|
||||
notNullParameters({ i: Int, j: Int ->
|
||||
if (i < 10 && j > 0) "" else ""
|
||||
})
|
||||
|
||||
nullableParameter({ i: Int, j: Int ->
|
||||
if (i == null) "" else ""
|
||||
})
|
||||
|
||||
nullableReturnType({ i: Int, j: Int ->
|
||||
if (i < 10) return@nullableReturnType null
|
||||
return@nullableReturnType "nya"
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fun notNullParameters(f: Function2<Int, Int, String>) {}
|
||||
fun nullableParameter(f: Function2<Int?, Int, String>) {}
|
||||
fun nullableReturnType(f: Function2<Int, Int, String?>) {}
|
||||
|
||||
|
||||
fun test() {
|
||||
notNullParameters({ i: Int, j: Int ->
|
||||
if (i < 10 && j > 0) "" else ""
|
||||
})
|
||||
|
||||
nullableParameter({ i: Int?, j: Int ->
|
||||
if (i == null) "" else ""
|
||||
})
|
||||
|
||||
nullableReturnType({ i: Int, j: Int ->
|
||||
if (i < 10) return@nullableReturnType null
|
||||
return@nullableReturnType "nya"
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user