stack allocated string array default struct field value not set #19483
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: cgen
Bugs/feature requests, that are related to the default C generating backend.
Unit: Type System
Bugs/feature requests, that are related to the V types system.
Describe the bug
[2]string
as a struct field is not given a default value automatically. Following the field type with= [2]string{}
allows it to work properly. This should be the default behavior.Reproduction Steps
Expected Behavior
Expected the code to print 2 empty strings.
Current Behavior
It prints the first empty string. But the second line is
println(NIL)
.Possible Solution
No response
Additional Information/Context
No response
V version
V full version: V 0.4.2 ae5b4bb.c030c5e
Environment details (OS name and version, etc.)
Note
You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.
Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.
The text was updated successfully, but these errors were encountered: