Bug 18142 – checkedint opOpAssign doesn't accept a checkedint
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-12-29T19:36:13Z
Last change time
2018-09-01T17:15:05Z
Assigned to
Neia Neutuladh
Creator
Neia Neutuladh
Comments
Comment #0 by dhasenan — 2017-12-29T19:36:13Z
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.