You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enumNums {
one=1two=2ten=10
}
fnmain() {
$for n in Nums.values {
println('${n.name}${n.value}${n.value:d}${int(n.value)}')
}
}
Reproduction Steps
The program prints four columns, the first one the enum's name field and the rest the enum's value field.
Expected Behavior
one 1 1 1
two 2 2 2
ten 10 10 10
Current Behavior
Program print four columns:
one one 1 1
two two 2 2
ten ten a 10
First column (name) is ok.
Second column (value) is wrong. Is not the value numeric but the string name.
Third column (value) is wrong. Now is numeric but seems forced to hexadecimal.
Fourth column (value) is ok until we make the explicit cast int().
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.8 58fc4de
Environment details (OS name and version, etc.)
V full version: V 0.4.8 58fc4de
OS: linux, Debian GNU/Linux 12 (bookworm) (VM)
Processor: 2 cpus, 64bit, little endian, Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
getwd: /home/admin/playground
vexe: /home/admin/v/v
vexe mtime: 2024-11-21 19:25:29
vroot: OK, value: /home/admin/v
VMODULES: OK, value: .vmodules
VTMP: OK, value: /tmp/v_0
Git version: git version 2.39.5
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 12.2.0-14) 12.2.0
emcc version: N/A
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
Describe the bug
The enum
value
field is not printed correctly.Code: https://play.vlang.io/p/d1e5b6c839
Reproduction Steps
The program prints four columns, the first one the enum's name field and the rest the enum's value field.
Expected Behavior
Current Behavior
Program print four columns:
First column (name) is ok.
Second column (value) is wrong. Is not the value numeric but the string name.
Third column (value) is wrong. Now is numeric but seems forced to hexadecimal.
Fourth column (value) is ok until we make the explicit cast
int()
.Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.8 58fc4de
Environment details (OS name and version, etc.)
Huly®: V_0.6-21380
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: