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
When a struct expects a type alias that is a unsigned integer, the compiler will let the code pass, when using a primitive unsigned integer type will not compile.
Reproduction Steps
This code will pass compilation:
modulemaintypePort=u16structApp {
port Port
}
fnmain() {
app:= App{
port: -1
}
}
V full version: V 0.4.7 e03bd3f
OS: linux, Linux version 6.8.0-48-generic (buildd@lcy02-amd64-040) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu122.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #4822.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 7 11:24:13 UTC 2
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Describe the bug
When a struct expects a type alias that is a unsigned integer, the compiler will let the code pass, when using a primitive unsigned integer type will not compile.
Reproduction Steps
This code will pass compilation:
When this code will produce an error:
Expected Behavior
To have an error when the first snippet code is compiled.
Current Behavior
No compilation error.
Possible Solution
No response
Additional Information/Context
No response
V version
0.4.7 e03bd3f
Environment details (OS name and version, etc.)
V full version: V 0.4.7 e03bd3f
OS: linux, Linux version 6.8.0-48-generic (buildd@lcy02-amd64-040) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1
22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #4822.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 7 11:24:13 UTC 2Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
getwd: /home/v
vexe: /opt/vlang/v
vexe mtime: 2024-09-26 07:47:51
vroot: OK, value: /opt/vlang
VMODULES: OK, value: /root/.vmodules
VTMP: OK, value: /tmp/v_0
env VFLAGS: "-cc gcc"
Git version: git version 2.40.3
Git vroot status: e03bd3f (398 commit(s) behind V master)
.git/config present: true
CC version: cc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924
thirdparty/tcc status: thirdparty-linuxmusl-amd64 a3e24da2
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.
Huly®: V_0.6-21311
The text was updated successfully, but these errors were encountered: