compile-time reflection error for enum/struct declared in other module #20948
Labels
Bug
This tag is applied to issues which reports bugs.
Comptime
Features processed during compile time, like $if, $for, $env etc
Unit: Compiler
Bugs/feature requests, that are related to the V compiler in general.
Unit: Parser
Bugs/feature requests, that are related to the V parser or syntax (*not* semantic ones).
Describe the bug
compile time looping over enum/struct fields throws compiler error
if enum/struct is declared in other module
Reproduction Steps
my_data.v
main.v
Expected Behavior
compile, print enum/struct's fields
Current Behavior
compile time error:
Possible Solution
No response
Additional Information/Context
Trying to work arround this with
type EnumAlias = module_a.MyEnumModule
and iterating over alias also gives error, but this time its builder errorV version
V 0.4.4 ac9b724
Environment details (OS name and version, etc.)
V full version: V 0.4.4 f603035.ac9b724
OS: linux, "EndeavourOS Linux"
Processor: 8 cpus, 64bit, little endian, 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
getwd: /H/_nobackup/Projects/v_errors/v_compiletime_for_enum
vexe: /H/_nobackup/mh/.local/share/v/v
vexe mtime: 2024-03-03 14:33:21
vroot: OK, value: /H/_nobackup/mh/.local/share/v
VMODULES: OK, value: /home/mh/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.44.0
Git vroot status: weekly.2024.06-140-gac9b724b
.git/config present: true
CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: thirdparty-linux-amd64 99683af0
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: