@@ -43,8 +43,15 @@ class Element extends @dotnet_element {
4343
4444 /**
4545 * 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 `"???"`.
4648 */
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+ }
4855
4956 /**
5057 * Gets the name of a primary CodeQL class to which this element belongs.
@@ -53,11 +60,12 @@ class Element extends @dotnet_element {
5360 * which they belong; for example, `AddExpr` is a primary class, but
5461 * `BinaryOperation` is not.
5562 *
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.
5967 */
60- string getAPrimaryQlClass ( ) { result = "???" }
68+ string getAPrimaryQlClass ( ) { none ( ) }
6169}
6270
6371/** An element that has a name. */
0 commit comments