@@ -6,27 +6,33 @@ private import codeql_ql.ast.internal.AstNodes
66private predicate definesPredicate (
77 FileOrModule m , string name , int arity , Predicate p , boolean public
88) {
9- m = getEnclosingModule ( p ) and
10- name = p .getName ( ) and
11- public = getPublicBool ( p ) and
12- arity = p .getArity ( )
13- or
14- // import X
15- exists ( Import imp , FileOrModule m0 |
16- m = getEnclosingModule ( imp ) and
17- m0 = imp .getResolvedModule ( ) and
18- not exists ( imp .importedAs ( ) ) and
19- definesPredicate ( m0 , name , arity , p , true ) and
20- public = getPublicBool ( imp )
21- )
22- or
23- // predicate X = Y
24- exists ( ClasslessPredicate alias |
25- m = getEnclosingModule ( alias ) and
26- name = alias .getName ( ) and
27- resolvePredicateExpr ( alias .getAlias ( ) , p ) and
28- public = getPublicBool ( alias ) and
29- arity = alias .getArity ( )
9+ (
10+ p instanceof NewTypeBranch or
11+ p instanceof ClasslessPredicate
12+ ) and
13+ (
14+ m = getEnclosingModule ( p ) and
15+ name = p .getName ( ) and
16+ public = getPublicBool ( p ) and
17+ arity = p .getArity ( )
18+ or
19+ // import X
20+ exists ( Import imp , FileOrModule m0 |
21+ m = getEnclosingModule ( imp ) and
22+ m0 = imp .getResolvedModule ( ) and
23+ not exists ( imp .importedAs ( ) ) and
24+ definesPredicate ( m0 , name , arity , p , true ) and
25+ public = getPublicBool ( imp )
26+ )
27+ or
28+ // predicate X = Y
29+ exists ( ClasslessPredicate alias |
30+ m = getEnclosingModule ( alias ) and
31+ name = alias .getName ( ) and
32+ resolvePredicateExpr ( alias .getAlias ( ) , p ) and
33+ public = getPublicBool ( alias ) and
34+ arity = alias .getArity ( )
35+ )
3036 )
3137}
3238
0 commit comments