Skip to content

Commit 52305da

Browse files
committed
Ruby: move string getAQualifiedName() up to ConstantAccess
1 parent d00c9ea commit 52305da

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ruby/ql/lib/codeql/ruby/ast/Constant.qll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ class ConstantAccess extends Expr, TConstantAccess {
208208
*/
209209
predicate hasGlobalScope() { none() }
210210

211+
/**
212+
* Gets a fully qualified name for this constant.
213+
*/
214+
string getAQualifiedName() { none() }
215+
211216
override string toString() { result = this.getName() }
212217

213218
override AstNode getAChild(string pred) {
@@ -295,10 +300,7 @@ class ConstantReadAccess extends ConstantAccess {
295300

296301
final override string getAPrimaryQlClass() { result = "ConstantReadAccess" }
297302

298-
/**
299-
* Gets a fully qualified name for this constant.
300-
*/
301-
string getAQualifiedName() { TResolved(result) = resolveConstantReadAccess(this) }
303+
override string getAQualifiedName() { TResolved(result) = resolveConstantReadAccess(this) }
302304
}
303305

304306
/**
@@ -359,7 +361,7 @@ class ConstantWriteAccess extends ConstantAccess {
359361
* constants up the namespace chain, the fully qualified name of a nested
360362
* constant can be ambiguous from just statically looking at the AST.
361363
*/
362-
string getAQualifiedName() { result = resolveConstantWriteAccess(this) }
364+
override string getAQualifiedName() { result = resolveConstantWriteAccess(this) }
363365

364366
/**
365367
* Gets a qualified name for this constant. Deprecated in favor of

0 commit comments

Comments
 (0)