We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 776a296 commit cb3da0eCopy full SHA for cb3da0e
swift/ql/lib/codeql/swift/elements/decl/ParamDecl.qll
@@ -1,4 +1,16 @@
1
-// generated by codegen/codegen.py, remove this comment if you wish to edit this file
2
private import codeql.swift.generated.decl.ParamDecl
+private import codeql.swift.elements.decl.AbstractFunctionDecl
3
4
-class ParamDecl extends ParamDeclBase { }
+class ParamDecl extends ParamDeclBase {
5
+ /** Gets the function which declares this parameter. */
6
+ AbstractFunctionDecl getDeclaringFunction() {
7
+ result.getAParam() = this
8
+ }
9
+
10
+ /** Gets the index of this parameter in its declaring function's parameter list. */
11
+ int getIndex() {
12
+ exists(AbstractFunctionDecl func |
13
+ func.getParam(result) = this
14
+ )
15
16
+}
0 commit comments