Skip to content

Commit 7c1aa84

Browse files
committed
Fixed bug where some predicates were flagged without return type even thought they had
1 parent a462ec9 commit 7c1aa84

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ql/ql/src/queries/style/ValidatePredicateGetReturns.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ predicate isGetPredicate(Predicate pred) { pred.getName().regexpMatch("(get|as)[
2121
/**
2222
* Checks if a predicate has a return type.
2323
*/
24-
predicate hasReturnType(Predicate pred) { exists(pred.getReturnType()) }
24+
predicate hasReturnType(Predicate pred) { exists(pred.getReturnTypeExpr()) }
2525

2626
/**
2727
* Checks if a predicate is an alias using getAlias().

ql/ql/test/queries/style/ValidatePredicateGetReturns/test.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ predicate assessment() { none() }
3535

3636
// OK -- starts with as and returns a value
3737
string asString() { result = "string" }
38+
39+
// OK -- starts with get and returns a value
40+
HiddenType getInjectableCompositeActionNode() {
41+
exists(HiddenType hidden | result = hidden.toString())
42+
}

0 commit comments

Comments
 (0)