-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust: insert CallExprBase
in the hierarchy
#17730
Conversation
rust/schema/annotations.py
Outdated
@@ -185,8 +185,15 @@ class _: | |||
``` | |||
""" | |||
|
|||
class FunctionOrMethodCallExpr(Expr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name FunctionOrMethodCallExpr
is a bit long. Perhaps shorted to CallExprBase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that, though I did not like breaking the -Expr
postfixing. On the other hand I find CallBaseExpr
confusing though. I also considered AnyCallExpr
, which I might be persuaded to. I like the explicitness of FunctionOrMethodCallExpr
that makes it clear what it is without having to go to its docs, but I do agree it's a bit long. Any thoughts on this @hvitved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should ClosureExpr's also share the same base-class ?If so the name FunctionOrMethodCallOrClosureExpr
would definitely get a bit too specific for my taste ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I prefer CallExprBase
, despite breaking the suffix Expr
invariant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, renaming now to CallExprBase
. ClosureExpr
is a function object (that may land or be referenced in CallExpr::expr
), not a call, so it should not come beneath this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes of course.
@@ -20,6 +20,7 @@ | |||
import codeql.rust.elements.BoxPat | |||
import codeql.rust.elements.BreakExpr | |||
import codeql.rust.elements.CallExpr | |||
import codeql.rust.elements.CallExprBase |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.CallExpr
Redundant import, the module is already imported inside
codeql.rust.elements.MethodCallExpr
private import internal.CallExprBaseImpl | ||
import codeql.rust.elements.ArgList | ||
import codeql.rust.elements.Attr | ||
import codeql.rust.elements.Expr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.ArgList
FunctionOrMethodCallExpr
in the hierarchyCallExprBase
in the hierarchy
As both
CallExpr
andMethodCallExpr
are generated, this required additions to the annotation machinery:Expr -> CallExprBase
)CallExprBase
, to avoid them being repeated in the derived classes)