Skip to content

Commit 5d7e64e

Browse files
committed
unified: Add test with @_exported import
1 parent 78671cd commit 5d7e64e

4 files changed

Lines changed: 17 additions & 0 deletions

File tree

unified/ql/lib/codeql/unified/internal/StaticNameBinding.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ predicate valueStep(NameBindingNode node1, NameBindingNode node2) {
212212
|
213213
node2 = getNodeFromUncertainScope(scope)
214214
or
215+
// TODO: Add support for '@_exported' with tests, so this gets exercised
215216
// Bulk re-exporting declarations
216217
exists(TopLevel top |
217218
declaration = top.getBody().getAStmt() and

unified/ql/test/library-tests/static-name-binding/package1/Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ let package = Package(
77
targets: [
88
.target(name: "Target1"),
99
.target(name: "Target2"),
10+
.target(name: "Target3"),
11+
.target(name: "Target4"),
1012
]
1113
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@_exported import Target2
2+
3+
public class C {} // name=Target3.C
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Target3 // re-exports Target2
2+
3+
private protocol P {
4+
let x1: A; // $ MISSING: access=Target2.A
5+
let x2: B.C; // $ MISSING: access=Target2.B access=Target2.B.C
6+
let x3: C; // $ access=Target3.C
7+
8+
let x4: Target3.A; // $ MISSING: access=Target2.A
9+
let x5: Target3.B.C; // $ MISSING: access=Target2.B access=Target2.B.C
10+
let x6: Target3.C; // $ access=Target3.C
11+
}

0 commit comments

Comments
 (0)