mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Fix whenexpr test
Prior to Kotlin 1.7 the gratuitous `?` was ignored for typing purposes; now it yields a `String?`. We should make the test work everywhere by using a real nullable type.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
class WhenExpr {
|
||||
fun taint() = Uri()
|
||||
|
||||
fun sink(s: String) { }
|
||||
fun sink(s: String?) { }
|
||||
|
||||
fun bad() {
|
||||
val s0 = taint()
|
||||
fun bad(b: Boolean) {
|
||||
val s0 = if (b) taint() else null
|
||||
sink(s0?.getQueryParameter())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
| WhenExpr.kt:7:14:7:20 | taint(...) | WhenExpr.kt:8:14:8:32 | <Stmt> |
|
||||
| WhenExpr.kt:7:21:7:27 | taint(...) | WhenExpr.kt:8:14:8:32 | <Stmt> |
|
||||
|
||||
Reference in New Issue
Block a user