mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Kotlin: Add KotlinType to localvars
This commit is contained in:
@@ -785,6 +785,7 @@ localvars(
|
||||
unique int id: @localvar,
|
||||
string nodeName: string ref,
|
||||
int typeid: @type ref,
|
||||
int kttypeid: @kt_type ref,
|
||||
int parentid: @localvariabledeclexpr ref
|
||||
);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ predicate hasName(Element e, string name) {
|
||||
name = "p" + pos
|
||||
)
|
||||
or
|
||||
localvars(e, name, _, _)
|
||||
localvars(e, name, _, _, _)
|
||||
or
|
||||
typeVars(e, name, _, _, _)
|
||||
or
|
||||
|
||||
@@ -1490,7 +1490,7 @@ class LocalVariableDeclExpr extends Expr, @localvariabledeclexpr {
|
||||
VarAccess getAnAccess() { variableBinding(result, this.getVariable()) }
|
||||
|
||||
/** Gets the local variable declared by this local variable declaration expression. */
|
||||
LocalVariableDecl getVariable() { localvars(result, _, _, this) }
|
||||
LocalVariableDecl getVariable() { localvars(result, _, _, _, this) }
|
||||
|
||||
/** Gets the type access of this local variable declaration expression. */
|
||||
Expr getTypeAccess() {
|
||||
|
||||
@@ -38,13 +38,16 @@ class LocalScopeVariable extends Variable, @localscopevariable {
|
||||
/** A local variable declaration */
|
||||
class LocalVariableDecl extends @localvar, LocalScopeVariable {
|
||||
/** Gets the type of this local variable. */
|
||||
override Type getType() { localvars(this, _, result, _) }
|
||||
override Type getType() { localvars(this, _, result, _, _) }
|
||||
|
||||
/** Gets the Kotlin type of this local variable. */
|
||||
override KotlinType getKotlinType() { localvars(this, _, _, result, _) }
|
||||
|
||||
/** Gets the expression declaring this variable. */
|
||||
LocalVariableDeclExpr getDeclExpr() { localvars(this, _, _, result) }
|
||||
LocalVariableDeclExpr getDeclExpr() { localvars(this, _, _, _, result) }
|
||||
|
||||
/** Gets the parent of this declaration. */
|
||||
Expr getParent() { localvars(this, _, _, result) }
|
||||
Expr getParent() { localvars(this, _, _, _, result) }
|
||||
|
||||
/** Gets the callable in which this declaration occurs. */
|
||||
override Callable getCallable() { result = this.getParent().getEnclosingCallable() }
|
||||
|
||||
Reference in New Issue
Block a user