Swift: Add test and accept output

This commit is contained in:
Mathias Vorreiter Pedersen
2022-05-27 11:48:20 +01:00
parent 45bbd24355
commit 6815e731d2
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
| types.swift:24:1:26:1 | throwingFunc | () throws -> Int | throws |
| types.swift:28:1:28:36 | asyncFunction | (Int) async -> () | async |
| types.swift:30:1:30:54 | throwingAndAsyncFunction | (Int) async throws -> () | async |
| types.swift:30:1:30:54 | throwingAndAsyncFunction | (Int) async throws -> () | throws |

View File

@@ -0,0 +1,12 @@
import codeql.swift.elements
from FuncDecl f, AnyFunctionType t, string s
where
f.getInterfaceType() = t and
f.getLocation().getFile().getName().matches("%swift/ql/test%") and
(
t.isAsync() and s = "async"
or
t.isThrowing() and s = "throws"
)
select f, t, s