Skip to content

Commit 7c1fb5d

Browse files
committed
Swift: Add qldoc for AutoClosureExpr.
1 parent 4eee375 commit 7c1fb5d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

swift/ql/lib/codeql/swift/elements/expr/AutoClosureExpr.qll

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,22 @@ private import codeql.swift.generated.expr.AutoClosureExpr
22
private import codeql.swift.elements.stmt.ReturnStmt
33
private import codeql.swift.elements.expr.Expr
44

5+
/**
6+
* A Swift autoclosure expression, that is, a closure automatically generated
7+
* around an argument when the parameter has the `@autoclosure` attribute. For
8+
* example, there is an `AutoClosureExpr` around the value `0` in:
9+
* ```
10+
* func myFunction(_ expr: @autoclosure () -> Int) {
11+
* ...
12+
* }
13+
*
14+
* myFunction(0)
15+
* ```
16+
*/
517
class AutoClosureExpr extends Generated::AutoClosureExpr {
6-
/** Gets the implicit return statement generated by this autoclosure expression. */
18+
/**
19+
* Gets the implicit return statement generated by this autoclosure expression.
20+
*/
721
ReturnStmt getReturn() { result = unique( | | this.getBody().getAnElement()) }
822

923
/**

0 commit comments

Comments
 (0)