mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Merge pull request #11177 from github/redsun82/swift-decls
Swift: extract `PoundDiagnosticDecl` and `MissingMemberDecl`
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
// generated by codegen/codegen.py
|
||||
|
||||
After a swift source file is added in this directory and codegen/codegen.py is run again, test queries
|
||||
will appear and this file will be deleted
|
||||
@@ -1,4 +0,0 @@
|
||||
// generated by codegen/codegen.py
|
||||
|
||||
After a swift source file is added in this directory and codegen/codegen.py is run again, test queries
|
||||
will appear and this file will be deleted
|
||||
@@ -0,0 +1,2 @@
|
||||
| diagnostics.swift:2:1:2:25 | #warning(...) | getModule: | file://:0:0:0:0 | diagnostics | getKind: | 2 | getMessage: | diagnostics.swift:2:10:2:10 | I'm a warning |
|
||||
| diagnostics.swift:3:1:3:26 | #error(...) | getModule: | file://:0:0:0:0 | diagnostics | getKind: | 1 | getMessage: | diagnostics.swift:3:8:3:8 | And I'm an error |
|
||||
@@ -0,0 +1,12 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from PoundDiagnosticDecl x, ModuleDecl getModule, int getKind, StringLiteralExpr getMessage
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() and
|
||||
getModule = x.getModule() and
|
||||
getKind = x.getKind() and
|
||||
getMessage = x.getMessage()
|
||||
select x, "getModule:", getModule, "getKind:", getKind, "getMessage:", getMessage
|
||||
@@ -0,0 +1,3 @@
|
||||
//codeql-extractor-expected-status: 1
|
||||
#warning("I'm a warning")
|
||||
#error("And I'm an error")
|
||||
Reference in New Issue
Block a user