[Issue 259] Comparing signed to unsigned does not generate an error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 7 06:50:42 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=259



--- Comment #54 from bearophile_hugs at eml.cc 2013-12-07 06:48:38 PST ---
If an immutable int x is inside the if branch that asserts it to be not
negative, the assignments and comparisons with an uint should not give
warnings:


uint z;
void main(string[] args) {
    immutable int x = args.length - 3;
    if (x >= 0) {
        uint y = x; // give no errors here
        if (x > z) {} // give no warning here.
    }
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list