Skip to content

Commit 5f6f72b

Browse files
committed
Kotlin: Add FP test case for ignored return value query
1 parent c70f3d3 commit 5f6f72b

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| Test.kt:14:29:14:33 | foo(...) | The result of the call is ignored, but 90% of calls to foo use the return value. |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Likely Bugs/Statements/ReturnValueIgnored.ql
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Foo {
2+
fun foo(): Int { return 5 }
3+
fun bar() {
4+
val x0 = foo()
5+
val x1 = foo()
6+
val x2 = foo()
7+
val x3 = foo()
8+
val x4 = foo()
9+
val x5 = foo()
10+
val x6 = foo()
11+
val x7 = foo()
12+
val x8 = foo()
13+
val x9 = foo()
14+
val x = if (true) { foo() } else 6
15+
}
16+
}

0 commit comments

Comments
 (0)