Skip to content

missing compilation message for fn f(x u8) {} f(9999), where the literal is clearly > 255 #26585

Description

@spytheman
V version: V 0.5.0 edd4a71, press to see full `v doctor` output
V full version V 0.5.0 b29ac57.edd4a71
OS linux, Ubuntu 20.04.6 LTS
Processor 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-3225 CPU @ 3.30GHz
Memory 2.54GB/15.42GB
V executable /home/delian/v/v
V last modified time 2026-02-12 07:32:06
V home dir OK, value: /home/delian/v
VMODULES OK, value: /home/delian/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/delian/v
env VFLAGS "-no-parallel"
Git version git version 2.50.0
V git status weekly.2026.07-22-gedd4a712
.git/config present true
cc version cc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
gcc version gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
clang version Ubuntu clang version 18.1.8 (11~20.04.2)
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.31-0ubuntu9.18) 2.31

What did you do?
./v -g -o vdbg cmd/v && ./vdbg x.v && x

fn f(a u8, c u8, m u8, xn u8) int {
	return int(a) + int(c) + int(m) + int(xn)
}

println(f(1256, 256, 256, 0xFFFFFFFF))

What did you see?

487

What did you expect to see?

Either a notice or a warning or an error at compile time, since 1256 and 256 and 0xFFFFFFFF are > 255, which is the maximum value for u8.

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

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.Unit: CheckerBugs/feature requests, that are related to the type checker.Unit: Type SystemBugs/feature requests, that are related to the V types system.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions