[Issue 18952] New: std.experimental.checkedint.Saturate prints integral promotion deprecation message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 6 16:24:17 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18952

          Issue ID: 18952
           Summary: std.experimental.checkedint.Saturate prints integral
                    promotion deprecation message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: greensunny12 at gmail.com

---
/dlang/dmd/linux/bin64/../../src/phobos/std/experimental/checkedint.d(2184):
Deprecation: integral promotion not done for ~cast(byte)0, use
'-transition=intpromote' switch or ~cast(int)(cast(byte)0)
---


---
import std.experimental.checkedint;

void main()
{
    auto x = (cast(byte) 127).checked!Saturate;
    assert(x == 127);
    x++;
    assert(x == 127);
}
---

https://run.dlang.io/is/8QMIT5

--


More information about the Digitalmars-d-bugs mailing list