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 struct field of fixed array init (fix #19483) #19487

Merged
merged 3 commits into from
Oct 1, 2023

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Oct 1, 2023

This PR fix struct field of fixed array init (fix #19483).

  • Fix struct field of fixed array init.
  • Add test.
struct Foo {
mut:
	bar [2]string
}

fn main() {
	foo := Foo{}
	println(foo.bar[0])
	assert foo.bar[0] == ''
}

PS D:\Test\v\tt1> v run .

@medvednikov medvednikov merged commit 6bd4539 into vlang:master Oct 1, 2023
46 checks passed
@yuyi98 yuyi98 deleted the fix_struct_fixed_array_field branch October 2, 2023 06:18
Wertzui123 pushed a commit to Wertzui123/v that referenced this pull request Oct 8, 2023
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.

stack allocated string array default struct field value not set
2 participants