-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.This bug has been confirmed to be valid by a contributor.Unit: CheckerBugs/feature requests, that are related to the type checker.Bugs/feature requests, that are related to the type checker.Unit: CompilerBugs/feature requests, that are related to the V compiler in general.Bugs/feature requests, that are related to the V compiler in general.
Description
V version: 0.2
OS: Windows 10 x64
What did you do?
I assigned an int to a mutable f32 variable
mut my_float_32 := f32(3.2)
my_int := int(2147483583)
my_float_32 = my_int // should fail to compile
What did you expect to see?
I expected a compilation error as implied by the documentation
An
intvalue for example can be automatically promoted tof64ori64but not tof32oru32. (f32would mean precision loss for large values andu32would mean loss of the sign for negative values).
What did you see instead?
The code compiled and ran without error but precision was lost
Metadata
Metadata
Assignees
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.This bug has been confirmed to be valid by a contributor.Unit: CheckerBugs/feature requests, that are related to the type checker.Bugs/feature requests, that are related to the type checker.Unit: CompilerBugs/feature requests, that are related to the V compiler in general.Bugs/feature requests, that are related to the V compiler in general.