Fix up NoneCall

In some contexts, `none()` is a formula. This means in general we cannot
assume `Call` is an `Expr`, but only know that it's an `AstNode`.
This commit is contained in:
Taus
2021-05-27 12:41:22 +00:00
committed by GitHub
parent a99a6a4721
commit 6aa64ba2cc
2 changed files with 3 additions and 3 deletions

View File

@@ -369,7 +369,7 @@ class NewTypeBranch extends TNewTypeBranch, AstNode {
override NewType getParent() { result.getABranch() = this }
}
class Call extends TCall, Expr {
class Call extends TCall, AstNode {
Expr getArgument(int i) {
none() // overriden in sublcasses.
}
@@ -425,7 +425,7 @@ class MemberCall extends TMemberCall, Call {
Expr getBase() { toGenerated(result) = expr.getChild(0) }
}
class NoneCall extends TNoneCall, Call {
class NoneCall extends TNoneCall, Call, Formula {
Generated::SpecialCall call;
NoneCall() { this = TNoneCall(call) }

View File

@@ -49,7 +49,7 @@ newtype TAstNode =
class TFormula =
TDisjunction or TConjunction or TComparisonFormula or TQuantifier or TNegation or TIfFormula or
TImplication or TInstanceOf;
TImplication or TInstanceOf or TNoneCall or TAnyCall;
class TBinOpExpr = TAddExpr;