Can't use const
value for fixed array that is a struct's field if const
was declared below struct declaration
#19593
Labels
Bug
This tag is applied to issues which reports bugs.
Build
V build error on any OS/CPU architecture.
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
If you have a struct with a field of type of fixed array, you must provide the size of the array. If you want to use the
const
value for this, and thisconst
is declared below the declaration of this struct, the compiler will output an error.Reproduction Steps
Expected Behavior
Compiled successfully
Current Behavior
Possible Solution
Additional Information/Context
No response
V version
V 0.4.2 fae46a8
Environment details (OS name and version, etc.)
Playground
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: