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

markused: fix short program with selector option unwrapping only #23111

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Dec 9, 2024

@felipensp felipensp changed the title markused: fix code dependency for selector with option type markused: fix short program with selector option unwrapping Dec 9, 2024
@felipensp felipensp changed the title markused: fix short program with selector option unwrapping markused: fix short program with selector option unwrapping only Dec 9, 2024
@felipensp felipensp marked this pull request as ready for review December 9, 2024 10:50
Comment on lines +1730 to +1731
&& !c.table.used_features.option_or_result {
c.table.used_features.option_or_result = true
Copy link
Member

@spytheman spytheman Dec 9, 2024

Choose a reason for hiding this comment

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

imho just always c.table.used_features.option_or_result = true (when the rest of the condition is true); there is no need to read it first and check it.

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.

Excellent work.

@spytheman spytheman merged commit 49e1012 into vlang:master Dec 9, 2024
72 checks passed
@felipensp felipensp deleted the fix_markused_selector_option branch December 10, 2024 17:56
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.

printing optional struct member causes c error: undefined symbol 'panic_option_not_set'
2 participants