Skip to content

Commit 3d5098a

Browse files
committed
Swift: Add failing test.
1 parent 1c298e6 commit 3d5098a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

swift/ql/test/library-tests/dataflow/capture/closures.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,10 @@ func simplestTest() {
151151
let x = source("simplestTest", 0)
152152
sink(x) // $ hasValueFlow=simplestTest
153153
}
154+
155+
func sideEffects() {
156+
var x = 0
157+
var f = { () in x = source("sideEffects", 1) }
158+
f()
159+
sink(x) // $ MISSING: hasValueFlow=sideEffects
160+
}

0 commit comments

Comments
 (0)