https://issues.dlang.org/show_bug.cgi?id=13352
Issue ID: 13352
Summary: Algebraic does not support binary arithmetic when
omitting small number types
Product: D
Version: D2
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: Phobos
Assignee: [email protected]
Reporter: [email protected]
For example, when defining Algebraic!(long) and then trying to add two such
values, or an algebraic with a raw number, opArithmetic will try to instantiate
an Algebraic!(long) with an int, which fails compilation.
---
alias TP = Algebraic!(long);
auto a = TP(1L);
auto b = TP(2L);
assert(a + b == 3L); // error
assert(a + 2 == 3L); // error
assert(1 + b == 3L); // error
---
--