From da777a455d50bc9e334f4148e80b9c9c0eeedecf Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Mon, 8 Jun 2026 23:09:45 +0200 Subject: [PATCH] Improve QLDoc --- go/ql/lib/semmle/go/Expr.qll | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/go/ql/lib/semmle/go/Expr.qll b/go/ql/lib/semmle/go/Expr.qll index 0dcc707b19d..d50456411fd 100644 --- a/go/ql/lib/semmle/go/Expr.qll +++ b/go/ql/lib/semmle/go/Expr.qll @@ -1049,16 +1049,28 @@ class FuncTypeExpr extends @functypeexpr, TypeExpr, ScopeNode, FieldParent { */ int getNumParameter() { result = count(this.getAParameterDecl().getANameExpr()) } - /** Gets the `i`th result of this function type (0-based). */ + /** + * Gets the `i`th result declaration of this function type (0-based). + * + * Note: `x, y int` is a single `ResultVariableDecl`. + */ ResultVariableDecl getResultDecl(int i) { result = this.getField(-(i + 1)) } - /** Gets a result of this function type. */ + /** + * Gets a result declaration of this function type. + * + * Note: `x, y int` is a single `ResultVariableDecl`. + */ ResultVariableDecl getAResultDecl() { result = this.getResultDecl(_) } /** Gets the number of results of this function type. */ int getNumResult() { result = count(this.getAResultDecl()) } - /** Gets the result of this function type, if there is only one. */ + /** + * Gets the result of this function type, if there is only one. + * + * Note: `x, y int` is a single `ResultVariableDecl`. + */ ResultVariableDecl getResultDecl() { this.getNumResult() = 1 and result = this.getAResultDecl() } override string toString() { result = "function type" }