@@ -43,8 +43,15 @@ class Element extends @dotnet_element {
43
43
44
44
/**
45
45
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
46
+ *
47
+ * If no primary class can be determined, the result is `"???"`.
46
48
*/
47
- final string getPrimaryQlClasses ( ) { result = concat ( this .getAPrimaryQlClass ( ) , "," ) }
49
+ final string getPrimaryQlClasses ( ) {
50
+ result = strictconcat ( this .getAPrimaryQlClass ( ) , "," )
51
+ or
52
+ not exists ( this .getAPrimaryQlClass ( ) ) and
53
+ result = "???"
54
+ }
48
55
49
56
/**
50
57
* Gets the name of a primary CodeQL class to which this element belongs.
@@ -53,11 +60,12 @@ class Element extends @dotnet_element {
53
60
* which they belong; for example, `AddExpr` is a primary class, but
54
61
* `BinaryOperation` is not.
55
62
*
56
- * This predicate always has a result. If no primary class can be
57
- * determined, the result is `"???"`. If multiple primary classes match,
58
- * this predicate can have multiple results.
63
+ * If no primary classes match, this predicate has no result. If multiple
64
+ * primary classes match, this predicate can have multiple results.
65
+ *
66
+ * See also `getPrimaryQlClasses`, which is better to use in most cases.
59
67
*/
60
- string getAPrimaryQlClass ( ) { result = "???" }
68
+ string getAPrimaryQlClass ( ) { none ( ) }
61
69
}
62
70
63
71
/** An element that has a name. */
0 commit comments