Class FuncLit
A function literal.
Examples:
func(x, y int) int { return x + y }
Import path
import semmle.go.ExprDirect supertypes
Predicates
| getAPrimaryQlClass | Gets the name of a primary CodeQL class to which this node belongs. |
| getBody | Gets the body of this function literal. |
| getType | |
| getTypeExpr | Gets the expression denoting the type of this function. |
| isPlatformIndependentConstant | Holds if this expression has a constant value which is guaranteed not to depend on the platform where it is evaluated. |
| toString | Gets a textual representation of this element. |
Inherited predicates
| getACall | Gets a call to this function. | from FuncDef |
| getAChild | Gets a child node of this node. | from AstNode |
| getAChildExpr | Gets an expression that is a child node of this node in the AST. | from ExprParent |
| getAChildStmt | Gets a statement that is a child node of this node in the AST. | from StmtParent |
| getADeferStmt | Gets a | from FuncDef |
| getAParameter | Gets a parameter of this function. | from FuncDef |
| getAResultVar | Gets a result variable of this function. | from FuncDef |
| getBoolValue | Gets the boolean value this expression evalutes to, if any. | from Expr |
| getChild | Gets the | from AstNode |
| getChildExpr | Gets the | from ExprParent |
| getChildStmt | Gets the | from StmtParent |
| getEnclosingFunction | Gets the innermost function definition to which this AST node belongs, if any. | from AstNode |
| getExactValue | Gets the string representation of the exact value this expression evaluates to, if any. | from Expr |
| getFile | Gets the file this program element comes from. | from Locatable |
| getFloatValue | Gets the floating-point value this expression evaluates to, if any. | from Expr |
| getGlobalValueNumber | Gets the global value number of this expression. | from Expr |
| getIntValue | Gets the integer value this expression evaluates to, if any. | from Expr |
| getKind | Gets the kind of this expression, which is an integer value representing the expression’s node type. | from Expr |
| getLocation | Gets this element’s location. | from Locatable |
| getName | Gets the name of the defined function, if any. | from FuncDef |
| getNumChild | Gets the number of child nodes of this node. | from AstNode |
| getNumChildExpr | Gets the number of child expressions of this node. | from ExprParent |
| getNumChildStmt | Gets the number of child statements of this node. | from StmtParent |
| getNumLines | Gets the number of lines covered by this element. | from Locatable |
| getNumParameter | Gets the number of parameters of this function. | from FuncDef |
| getNumericValue | Gets either | from Expr |
| getParameter | Gets the | from FuncDef |
| getParent | Gets the parent node of this AST node, if any. | from AstNode |
| getPrimaryQlClasses | Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. | from AstNode |
| getResultVar | Gets the | from FuncDef |
| getScope | Gets the scope induced by this function. | from FuncDef |
| getStringValue | Gets the string value this expression evaluates to, if any. | from Expr |
| getUniquelyNumberedChild | Get an AstNode child, ordered by child kind and then by index. | from AstNode |
| hasComplexValue | Holds if the complex value this expression evaluates to has real part | from Expr |
| hasLocationInfo | Holds if this element is at the specified location. The location spans column | from Locatable |
| isConst | Holds if this expression is constant, that is, if its value is determined at compile-time. | from Expr |
| isVariadic | Holds if this function is variadic. | from FuncDef |
| mayHaveOwnSideEffects | Holds if this expression may have observable side effects of its own (that is, independent of whether its sub-expressions may have side effects). | from Expr |
| mayHaveSideEffects | Holds if the evaluation of this expression may produce observable side effects. | from Expr |
| stripParens | Gets this expression, with any surrounding parentheses removed. | from Expr |