Skip to content

Conversation

@redsun82
Copy link
Contributor

@redsun82 redsun82 commented Dec 3, 2024

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 synthesized hierarchy of those two classes under a new ArrayExpr class.

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.
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Dec 3, 2024

private import internal.ArrayRepeatExprImpl
import codeql.rust.elements.ArrayExpr
import codeql.rust.elements.Expr

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.ArrayExpr
.
/**
* Gets the `index`th attr of this array expression (0-based).
*/
Attr getAttr(int index) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed now

@redsun82 redsun82 requested a review from paldepind December 3, 2024 15:13
Copy link
Contributor

@paldepind paldepind left a 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 :)

@redsun82 redsun82 merged commit 4bf7bbb into main Dec 4, 2024
22 checks passed
@redsun82 redsun82 deleted the redsun82/rust-array-expr branch December 4, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants