-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.ComptimeFeatures processed during compile time, like $if, $for, $env etcFeatures processed during compile time, like $if, $for, $env etc
Description
Describe the bug
According to doc.md,
$int => matches int, i8, i16, i32, i64, u8, u16, u32, u64, isize, usize and integer literals.
Reproduction Steps
f.v
module main
fn main() {
x := i32(77)
$if x is $int {
println(x)
} $else {
println('fail')
}
}
Expected Behavior
77
Current Behavior
fail
Possible Solution
workaround :
module main
fn main() {
x := i32(77)
$if x is i32 {
println(x)
} $else {
println('fail')
}
}
Additional Information/Context
No response
V version
V 0.4.10 d9b808c.d9b808c
Environment details (OS name and version, etc.)
V full version | V 0.4.10 d9b808c.d9b808c |
---|---|
OS | linux, Ubuntu 24.04.2 LTS |
Processor | 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz |
Memory | 9.98GB/15.51GB |
V executable | /media/HD/github/kbkpbot/v/v |
V last modified time | 2025-04-27 13:23:04 |
V home dir | OK, value: /media/HD/github/kbkpbot/v |
VMODULES | OK, value: /home/mars/.vmodules |
VTMP | OK, value: /tmp/v_1000 |
Current working dir | OK, value: /home/mars/v/bug |
Git version | git version 2.43.0 |
V git status | weekly.2025.17-5-g048ec461 |
.git/config present | true |
cc version | cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 |
gcc version | gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 |
clang version | Ubuntu clang version 18.1.3 (1ubuntu1) |
tcc version | tcc version 0.9.28rc 2025-02-13 HEAD@f8bd136d (x86_64 Linux) |
tcc git status | thirdparty-linux-amd64 696c1d84 |
emcc version | N/A |
glibc version | ldd (Ubuntu GLIBC 2.39-0ubuntu8.4) 2.39 |
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.
Metadata
Metadata
Assignees
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.ComptimeFeatures processed during compile time, like $if, $for, $env etcFeatures processed during compile time, like $if, $for, $env etc