Skip to content

Commit 8cc46c7

Browse files
committed
Improve QLDoc
1 parent cc7bfab commit 8cc46c7

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

go/ql/lib/semmle/go/Expr.qll

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,16 +1049,28 @@ class FuncTypeExpr extends @functypeexpr, TypeExpr, ScopeNode, FieldParent {
10491049
*/
10501050
int getNumParameter() { result = count(this.getAParameterDecl().getANameExpr()) }
10511051

1052-
/** Gets the `i`th result of this function type (0-based). */
1052+
/**
1053+
* Gets the `i`th result declaration of this function type (0-based).
1054+
*
1055+
* Note: `x, y int` is a single `ResultVariableDecl`.
1056+
*/
10531057
ResultVariableDecl getResultDecl(int i) { result = this.getField(-(i + 1)) }
10541058

1055-
/** Gets a result of this function type. */
1059+
/**
1060+
* Gets a result declaration of this function type.
1061+
*
1062+
* Note: `x, y int` is a single `ResultVariableDecl`.
1063+
*/
10561064
ResultVariableDecl getAResultDecl() { result = this.getResultDecl(_) }
10571065

10581066
/** Gets the number of results of this function type. */
10591067
int getNumResult() { result = count(this.getAResultDecl()) }
10601068

1061-
/** Gets the result of this function type, if there is only one. */
1069+
/**
1070+
* Gets the result of this function type, if there is only one.
1071+
*
1072+
* Note: `x, y int` is a single `ResultVariableDecl`.
1073+
*/
10621074
ResultVariableDecl getResultDecl() { this.getNumResult() = 1 and result = this.getAResultDecl() }
10631075

10641076
override string toString() { result = "function type" }

0 commit comments

Comments
 (0)