Skip to content

Commit ccc7563

Browse files
committed
RB: HACK: relax types to silence compiler errors
1 parent 50d0ce1 commit ccc7563

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

ruby/ql/lib/codeql/ruby/AST.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ class AstNode extends TAstNode {
7777
final File getFile() { result = this.getLocation().getFile() }
7878

7979
/** Gets a child node of this `AstNode`. */
80-
final AstNode getAChild() { result = this.getAChild(_) }
80+
final AstNode getAChild() {
81+
result = this.getAChild(_) or
82+
none() // TODO: Remove hack.
83+
}
8184

8285
/** Gets the parent of this `AstNode`, if this node is not a root node. */
8386
final AstNode getParent() { result.getAChild() = this }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ class BodyStmt extends StmtSequence, TBodyStmt {
205205
/** Gets the `ensure` clause in this block, if any. */
206206
final StmtSequence getEnsure() {
207207
result = unique(Ensure s | toGenerated(s) = getBodyStmtChild(this, _))
208+
or
209+
none() // TODO: remove hack.
208210
}
209211

210212
/** Holds if this block has an `ensure` block. */

ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ private AstNode specialParentOfInclSynth(AstNode n) {
130130
result.(Namespace).getScopeExpr(), result.(ClassDeclaration).getSuperclassExpr(),
131131
result.(SingletonMethod).getObject(), result.(SingletonClass).getValue()
132132
]
133+
or
134+
none() // TODO: Remove hack.
133135
}
134136

135137
private AstNode parentOfInclSynth(AstNode n) {

0 commit comments

Comments
 (0)