mirror of
https://github.com/github/codeql.git
synced 2026-06-19 03:41:07 +02:00
Fix: getNumResult() was wrong in some cases
It was the number of result declarations, which is different from the number of results when one result declaration declares more than one variable, as in `x, y int`.
This commit is contained in:
@@ -1063,8 +1063,8 @@ class FuncTypeExpr extends @functypeexpr, TypeExpr, ScopeNode, FieldParent {
|
||||
*/
|
||||
ResultVariableDecl getAResultDecl() { result = this.getResultDecl(_) }
|
||||
|
||||
/** Gets the number of results of this function type. */
|
||||
int getNumResult() { result = count(this.getAResultDecl()) }
|
||||
/** Gets the number of result parameters of this function type. */
|
||||
int getNumResult() { result = count(this.getAResultDecl().getANameExpr()) }
|
||||
|
||||
/**
|
||||
* Gets the result of this function type, if there is only one.
|
||||
|
||||
Reference in New Issue
Block a user