1
1
private import codeql.swift.generated.decl.EnumElementDecl
2
- private import codeql.swift.elements.decl.Decl
2
+ private import codeql.swift.elements.decl.EnumDecl
3
3
4
4
/**
5
5
* An enum element declaration, for example `enumElement` and `anotherEnumElement` in:
@@ -14,25 +14,24 @@ class EnumElementDecl extends Generated::EnumElementDecl {
14
14
override string toString ( ) { result = this .getName ( ) }
15
15
16
16
/**
17
- * Holds if this function is called `funcName ` and is a member of a
18
- * class, struct, extension, enum or protocol called `typeName `.
17
+ * Holds if this enum element declaration is called `enumElementName ` and is a member of an
18
+ * enum called `enumName `.
19
19
*/
20
20
cached
21
- predicate hasQualifiedName ( string typeName , string enumElementName ) {
21
+ predicate hasQualifiedName ( string enumName , string enumElementName ) {
22
22
this .getName ( ) = enumElementName and
23
- exists ( Decl d |
24
- d .asNominalTypeDecl ( ) . getFullName ( ) = typeName and
23
+ exists ( EnumDecl d |
24
+ d .getFullName ( ) = enumName and
25
25
d .getAMember ( ) = this
26
26
)
27
27
}
28
28
29
29
/**
30
- * Holds if this function is called `funcName` and is a member of a
31
- * class, struct, extension, enum or protocol called `typeName` in a module
32
- * called `moduleName`.
30
+ * Holds if this enum element declaration is called `enumElementName` and is a member of an
31
+ * enumcalled `enumName` in a module called `moduleName`.
33
32
*/
34
- predicate hasQualifiedName ( string moduleName , string typeName , string enumElementName ) {
35
- this .hasQualifiedName ( typeName , enumElementName ) and
33
+ predicate hasQualifiedName ( string moduleName , string enumName , string enumElementName ) {
34
+ this .hasQualifiedName ( enumName , enumElementName ) and
36
35
this .getModule ( ) .getFullName ( ) = moduleName
37
36
}
38
37
}
0 commit comments