Skip to content

Commit a3ef5c6

Browse files
committed
Swift: QLDoc Diagnostics.qll.
1 parent e0f16f4 commit a3ef5c6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

swift/ql/lib/codeql/swift/elements/Diagnostics.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
private import codeql.swift.generated.Diagnostics
22

3+
/**
4+
* A compiler-generated error, warning, note or remark.
5+
*/
36
class Diagnostics extends Generated::Diagnostics {
47
override string toString() { result = this.getSeverity() + ": " + this.getText() }
58

9+
/**
10+
* Gets a string representing the severity of this compiler diagnostic.
11+
*/
612
string getSeverity() {
713
this.getKind() = 1 and result = "error"
814
or
@@ -14,18 +20,30 @@ class Diagnostics extends Generated::Diagnostics {
1420
}
1521
}
1622

23+
/**
24+
* A compiler error message.
25+
*/
1726
class CompilerError extends Diagnostics {
1827
CompilerError() { this.getSeverity() = "error" }
1928
}
2029

30+
/**
31+
* A compiler-generated warning.
32+
*/
2133
class CompilerWarning extends Diagnostics {
2234
CompilerWarning() { this.getSeverity() = "warning" }
2335
}
2436

37+
/**
38+
* A compiler-generated note (typically attached to an error or warning).
39+
*/
2540
class CompilerNote extends Diagnostics {
2641
CompilerNote() { this.getSeverity() = "note" }
2742
}
2843

44+
/**
45+
* A compiler-generated remark (milder than a warning, this does not indicate an issue).
46+
*/
2947
class CompilerRemark extends Diagnostics {
3048
CompilerRemark() { this.getSeverity() = "remark" }
3149
}

0 commit comments

Comments
 (0)