[Issue 13352] Algebraic does not support binary arithmetic when omitting small number types

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Aug 22 03:18:31 PDT 2014


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

bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc

--- Comment #2 from bearophile_hugs at eml.cc ---
assert(a + b == 3L); // error
assert(a + 2 == 3L); // error
assert(1 + b == 3L); // error

I think giving an error is correct. An algebraic data type is not meant to be
transparent to arithmetic operations, it's a way to bundle alternative types.

--


More information about the Digitalmars-d-bugs mailing list