Skip to content
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

cgen: fix codegen for nested if on return #23729

Merged
merged 3 commits into from
Feb 15, 2025

Conversation

felipensp
Copy link
Member

Fix #23723

Copy link

Connected to Huly®: V_0.6-22147

}

fn test_main() {
c := chan Message{}
Copy link
Member

Choose a reason for hiding this comment

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

hm, why is c := chan Message{} needed, and why there is not a warning, that it is not used later?

Comment on lines +204 to +206
defer {
g.last_if_option_type = tmp_if_option_type
}
Copy link
Member

Choose a reason for hiding this comment

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

move the defer after line 197

Copy link
Member

Choose a reason for hiding this comment

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

it will be much less error prone that way, and it will work when the defer becomes scope based

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

@spytheman spytheman marked this pull request as ready for review February 15, 2025 20:53
@spytheman spytheman merged commit f4aa139 into vlang:master Feb 15, 2025
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C compilation error with generics and nested if expressions
2 participants