Checking that input variable is really used
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
import java.util.*
|
||||
|
||||
fun foo(list: List<String>): String? {
|
||||
val random = Random()
|
||||
for (s in list) {
|
||||
if (random.nextBoolean()) {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
fun foo(list: List<String>, target: MutableList<Int>) {
|
||||
<caret>for (s in list) {
|
||||
if (s.length > 0)
|
||||
target.add(0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user