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.
Comment #1 by dhasenan — 2018-08-29T20:12:03Z
Comment #2 by github-bugzilla — 2018-09-01T17:15:05Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/2ca2824f7ec5da981ae676060f2c0cfde7f06eaf Fix issue 18142 - checkint opOpAssign doesn't accept checkedints https://github.com/dlang/phobos/commit/e7990e0f79c6d06a58ad79e12bb92de8bc848f63 Merge pull request #6685 from dhasenan/checkedint_opopassign Fix issue 18142 - checkint opOpAssign doesn't accept checkedints merged-on-behalf-of: Nathan Sashihara <[email protected]>