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, checker: fix loop on aggregate of array of sumtype #19988

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Nov 24, 2023

Fix #18548

🤖[deprecated] Generated by Copilot at 1aa8120

This pull request adds support for using for-in loops over sum types that only contain array-like types, such as arrays, slices, or structs with array fields. It modifies the checker and the C generator to handle this case and adds a test file to verify the functionality.

🤖[deprecated] Generated by Copilot at 1aa8120

  • Handle for-in loop over sum types with array-like types (link, link)

@felipensp felipensp changed the title cgen, checker: fix loop on array of sumtype cgen, checker: fix loop on aggregate of array of sumtype Nov 24, 2023
@felipensp felipensp marked this pull request as ready for review November 25, 2023 15:30
@spytheman
Copy link
Member

(rebased over current master)

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 90c3ca3 into vlang:master Nov 26, 2023
53 of 54 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.

for loop not possible for indexexpr with sumtype of array types in coma separated match branch
2 participants