-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rust: distinguish [a, b] from [a; b]
#18190
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
Conversation
This splits the `ArrayExpr` class into `ArrayListExpr` and `ArrayRepeatExpr`. This uses the `synth.from_class` machinery to integrate seamlessly into the generated code, by hiding the extracted `ArrayExpr` behind an internal class and replacing it with a hierarchy of those two classes under a new `ArrayExpr` class.
|
|
||
| private import internal.ArrayRepeatExprImpl | ||
| import codeql.rust.elements.ArrayExpr | ||
| import codeql.rust.elements.Expr |
Check warning
Code scanning / CodeQL
Redundant import Warning
codeql.rust.elements.ArrayExpr
| /** | ||
| * Gets the `index`th attr of this array expression (0-based). | ||
| */ | ||
| Attr getAttr(int index) { |
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.
Did we loose the predicates to get attributes on ArrayExpr? Or are they somehow still there in some way I'm not seeing.
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, no, it's me that I forgot
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.
good catch!
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.
fixed now
paldepind
left a comment
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.
Thanks for improving this :)
This splits the
ArrayExprclass intoArrayListExprandArrayRepeatExpr. This uses thesynth.from_classmachinery to integrate seamlessly into the generated code, by hiding the extractedArrayExprbehind an internal class and replacing it with a synthesized hierarchy of those two classes under a newArrayExprclass.