Skip to content

Commit aeeafd7

Browse files
committed
Swift: Add a test for flow through OpenExistentialExpr.
1 parent a966944 commit aeeafd7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,3 +924,5 @@
924924
| test.swift:766:9:766:9 | f | test.swift:766:9:766:9 | SSA def(f) |
925925
| test.swift:766:13:766:29 | #keyPath(...) | test.swift:766:9:766:9 | f |
926926
| test.swift:766:13:766:29 | enter #keyPath(...) | test.swift:766:26:766:26 | KeyPathComponent |
927+
| test.swift:774:30:774:33 | SSA def(x) | test.swift:775:12:775:12 | x |
928+
| test.swift:774:30:774:33 | x | test.swift:774:30:774:33 | SSA def(x) |

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,3 +766,11 @@ func testOptionalKeyPathForce() {
766766
let f = \S2_Optional.s!.x
767767
sink(arg: s2[keyPath: f]) // $ flow=764
768768
}
769+
770+
protocol MyProtocol {
771+
func source() -> Int
772+
}
773+
774+
func testOpenExistentialExpr(x: MyProtocol) {
775+
sink(arg: x.source()) // $ MISSING:flow=771
776+
}

0 commit comments

Comments
 (0)