[Issue 18142] New: checkedint opOpAssign doesn't accept a checkedint
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 29 19:36:13 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=18142
Issue ID: 18142
Summary: checkedint opOpAssign doesn't accept a checkedint
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: dhasenan at gmail.com
Test case:
---
import std.experimental.checkedint;
void main()
{
alias cint = Checked!(int, Throw);
cint a = 10;
cint b = 10;
b += a;
}
---
Actual result:
Error: 'b += a' is not a scalar, it is a Checked!(int, Throw)
Expected result: the example should compile, and b shoulod get the value 20.
--
More information about the Digitalmars-d-bugs
mailing list