Skip to content

Commit 6815e73

Browse files
committed
Swift: Add test and accept output
1 parent 45bbd24 commit 6815e73

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| types.swift:24:1:26:1 | throwingFunc | () throws -> Int | throws |
2+
| types.swift:28:1:28:36 | asyncFunction | (Int) async -> () | async |
3+
| types.swift:30:1:30:54 | throwingAndAsyncFunction | (Int) async throws -> () | async |
4+
| types.swift:30:1:30:54 | throwingAndAsyncFunction | (Int) async throws -> () | throws |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import codeql.swift.elements
2+
3+
from FuncDecl f, AnyFunctionType t, string s
4+
where
5+
f.getInterfaceType() = t and
6+
f.getLocation().getFile().getName().matches("%swift/ql/test%") and
7+
(
8+
t.isAsync() and s = "async"
9+
or
10+
t.isThrowing() and s = "throws"
11+
)
12+
select f, t, s

0 commit comments

Comments
 (0)