Skip to content

C#: Extract assignments for field/property initializers #1741

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

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Aug 15, 2019

A small extractor extension in preparation for data-flow through fields.

@hvitved hvitved force-pushed the csharp/extract-field-inits branch from cc04267 to 495e5bc Compare August 15, 2019 14:19
@hvitved hvitved added the C# label Aug 15, 2019
@hvitved hvitved requested a review from calumgrant August 15, 2019 17:40
@hvitved hvitved marked this pull request as ready for review August 15, 2019 17:40
@hvitved hvitved requested a review from a team as a code owner August 15, 2019 17:40
Copy link
Contributor

@calumgrant calumgrant left a comment

Choose a reason for hiding this comment

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

Overall, I like this change, because these additional expressions could form part of the control flow graph of the constructor. However, we don't need to do this here - I've created a ticket for this instead: https://jira.semmle.com/browse/ODASA-8050

Expr e;

InitializerDefinition() { this = TInitializer(a, e) }
InitializerDefinition() { this.getAssignment().getParent() = fieldOrProp}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tsk tsk autoformat

@calumgrant calumgrant merged commit b28241a into github:master Aug 16, 2019
@hvitved hvitved deleted the csharp/extract-field-inits branch August 16, 2019 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants