We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code: https://play.vlang.io/p/9c7847226e
struct People { count int } interface IPeople { count int } p := IPeople(People{42}) dump(p.count) $for f in IPeople.fields { dump(p.$(f.name)) }
https://play.vlang.io/?query=9c7847226e
[code.v:10] p.count: 42 [code.v:12] p.$(f.name): 42
Output:
[code.v:10] p.count: 42 [code.v:12] p.$(f.name): 838049760
No response
V 0.4.4 f472355
V full version: V 0.4.4 f472355 OS: linux, Debian GNU/Linux 11 (bullseye) (VM) Processor: 1 cpus, 64bit, little endian, Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz getwd: /home/admin/playground vexe: /home/admin/v/v vexe mtime: 2024-02-18 15:23:23 vroot: OK, value: /home/admin/v VMODULES: OK, value: .vmodules VTMP: OK, value: /tmp/v_0 Git version: git version 2.30.2 Git vroot status: Error: fatal: detected dubious ownership in repository at '/home/admin/v' To add an exception for this directory, call: git config --global --add safe.directory /home/admin/v .git/config present: true CC version: cc (Debian 10.2.1-6) 10.2.1 20210110 thirdparty/tcc status: Error: fatal: detected dubious ownership in repository at '/home/admin/v/thirdparty/tcc' To add an exception for this directory, call: git config --global --add safe.directory /home/admin/v/thirdparty/tcc Error: fatal: detected dubious ownership in repository at '/home/admin/v/thirdparty/tcc' To add an exception for this directory, call: git config --global --add safe.directory /home/admin/v/thirdparty/tcc
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:
That works:
struct People { count int } interface IPeople { count int } p := IPeople(People{42}) dump(p.count) $for f in IPeople.fields { dump(unsafe { *&int(voidptr(p.$(f.name))) }) }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
Code: https://play.vlang.io/p/9c7847226e
Reproduction Steps
https://play.vlang.io/?query=9c7847226e
Expected Behavior
[code.v:10] p.count: 42
[code.v:12] p.$(f.name): 42
Current Behavior
Output:
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.4 f472355
Environment details (OS name and version, etc.)
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: