[Issue 18024] New: checkedint should be usable in @safe nothrow pure @nogc

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 1 08:09:59 UTC 2017


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

          Issue ID: 18024
           Summary: checkedint should be usable in @safe nothrow pure
                    @nogc
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: greensunny12 at gmail.com

void main(string[] args) @safe @nogc nothrow pure
{
     import std.experimental.checkedint : checked;
     auto f = (2.checked + 3).get;
}


foo.d(4): Error: pure function 'D main' cannot call impure function
'std.experimental.checkedint.Checked!(int, Abort).Checked.opBinary!("+",
int).opBinary'
foo.d(4): Error: @safe function 'D main' cannot call @system function
'std.experimental.checkedint.Checked!(int, Abort).Checked.opBinary!("+",
int).opBinary'
foo.d(4): Error: @nogc function 'D main' cannot call non- at nogc function
'std.experimental.checkedint.Checked!(int, Abort).Checked.opBinary!("+",
int).opBinary'
foo.d(4): Error: function std.experimental.checkedint.Checked!(int,
Abort).Checked.opBinary!("+", int).opBinary is not nothrow

--


More information about the Digitalmars-d-bugs mailing list