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:
Chris Smowton
2022-06-22 15:10:18 +01:00
parent e64a8bc79a
commit 1aae3c5f5e
2 changed files with 4 additions and 4 deletions

View File

@@ -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())
}
}

View File

@@ -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> |