Map of fixed array initialisations #22133
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.
Describe the bug
Having a struct with a field of type map[string][VALUE]Struct generates faulty C code.
The snippet breaks at the following line
est.mod_files['main'][i] = File{}
where switching the index to an integer literal no longer brakes the program.Reproduction Steps
Expected Behavior
The expected behaviour is that one set individual elements of the array.
Current Behavior
The program compiles but provides a C error
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.7 01fd719
Environment details (OS name and version, etc.)
V full version: V 0.4.7 39e550f.01fd719
OS: macos, macOS, 14.5, 23F79
Processor: 8 cpus, 64bit, little endian, Apple M2
getwd: /Users/andreas/dev/zlang
vexe: /Users/andreas/v/v
vexe mtime: 2024-08-29 18:02:46
vroot: OK, value: /Users/andreas/v
VMODULES: OK, value: /Users/andreas/.vmodules
VTMP: OK, value: /tmp/v_501
Git version: git version 2.45.1
Git vroot status: weekly.2024.24-338-g01fd7191
.git/config present: true
CC version: Apple clang version 15.0.0 (clang-1500.3.9.4)
thirdparty/tcc status: thirdparty-macos-arm64 5c1d002f
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: