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 array contains codegen for fixed array #22579

Merged
merged 3 commits into from
Oct 20, 2024

Conversation

felipensp
Copy link
Member

Fix #22559

@felipensp felipensp changed the title cgen: fix array containds codegen for fixed array cgen: fix array contains codegen for fixed array Oct 18, 2024
@@ -0,0 +1,8 @@
fn test_main() {
mut a := [][2]int{}
a << [0, 0]!
Copy link
Member

Choose a reason for hiding this comment

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

0 is not a good value for testing, because the default initialisation also uses 0s.
Using another value like 1, 3, or 42 makes the test more sensitive/less likely to continue to work, if eventually a value was overwritten (wrongly) by 0s in the implementation.

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 marked this pull request as ready for review October 20, 2024 00:55
@spytheman spytheman merged commit d8edb13 into vlang:master Oct 20, 2024
78 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.

Short program using arrays fails to compile
2 participants