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: [email protected]
Reporter: [email protected]
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-@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
--