File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
swift/ql/lib/codeql/swift/elements/expr Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,22 @@ private import codeql.swift.generated.expr.AutoClosureExpr
2
2
private import codeql.swift.elements.stmt.ReturnStmt
3
3
private import codeql.swift.elements.expr.Expr
4
4
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
+ */
5
17
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
+ */
7
21
ReturnStmt getReturn ( ) { result = unique( | | this .getBody ( ) .getAnElement ( ) ) }
8
22
9
23
/**
You can’t perform that action at this time.
0 commit comments