Skip to content

Commit 7209617

Browse files
committed
Improve QLDoc for CaseClause
1 parent fe24710 commit 7209617

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

go/ql/lib/semmle/go/Stmt.qll

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,25 @@ class IfStmt extends @ifstmt, Stmt, ScopeNode {
747747
* ```
748748
*/
749749
class CaseClause extends @caseclause, Stmt, ScopeNode {
750-
/** Gets the `i`th expression of this `case` clause (0-based). */
750+
/**
751+
* Gets the `i`th expression of this `case` clause (0-based).
752+
*
753+
* Note that the default clause does not have any expressions.
754+
*/
751755
Expr getExpr(int i) { result = this.getChildExpr(-(i + 1)) }
752756

753-
/** Gets an expression of this `case` clause. */
757+
/**
758+
* Gets an expression of this `case` clause, if any.
759+
*
760+
* Note that the default clause does not have any expressions.
761+
*/
754762
Expr getAnExpr() { result = this.getAChildExpr() }
755763

756-
/** Gets the number of expressions of this `case` clause. */
764+
/**
765+
* Gets the number of expressions of this `case` clause.
766+
*
767+
* Note that the default clause does not have any expressions.
768+
*/
757769
int getNumExpr() { result = this.getNumChildExpr() }
758770

759771
/** Gets the `i`th statement of this `case` clause (0-based). */

0 commit comments

Comments
 (0)