mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
Add comment about x, y int being a single ResultVariableDecl
This commit is contained in:
@@ -667,6 +667,10 @@ class ReceiverDecl extends FieldBase, Documentable, ExprParent {
|
||||
* func f4(input string) (output string, err error) { return}
|
||||
* func f5(e error) (x, y int) { return }
|
||||
* ```
|
||||
*
|
||||
* Note: `x, y int` is a single `ResultVariableDecl` even though it declares
|
||||
* two different result variables. Use the member predicate `getTypeExpr()` to
|
||||
* get `int`, `getNameExpr(0)` to get `x` and `getNameExpr(1)` to get `y`.
|
||||
*/
|
||||
class ResultVariableDecl extends ParameterOrResultDecl {
|
||||
ResultVariableDecl() { rawIndex < 0 }
|
||||
|
||||
Reference in New Issue
Block a user