Skip to content

C#: Fix global statement extraction #9610

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 2 commits into from
Jun 20, 2022

Conversation

tamasvajk
Copy link
Contributor

@tamasvajk tamasvajk commented Jun 20, 2022

This PR fixes global statement extraction. Previously the implicit main method was extracted first, and then its body and statements were extracted independently. However, the statement extraction requires to be run in a method extraction context because it expects the tag stack to contain the current method. This PR fixes this by extracting the global statements as if they appeared inside the implicit main method.

The first commit in this PR shows that there was an extraction error before the fix in the second commit is applied.

This issue was reported recently in #9536.

@github-actions github-actions bot added the C# label Jun 20, 2022
@tamasvajk tamasvajk marked this pull request as ready for review June 20, 2022 09:32
@tamasvajk tamasvajk requested a review from a team as a code owner June 20, 2022 09:32
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@tamasvajk tamasvajk merged commit f737804 into github:main Jun 20, 2022
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