D-Programming-Language/phobos — pull request #2452 by s-ludwig (2014-08-22 09:39:55+00:00)
Title: Fix issue #13352 - Only perform Algebraic arithmetic with allowed types.

Adds a static check allowed!T before trying any particular numeric type. Also checks for an exact type match in case of a raw (non-Variant) operand and prefers that to one of the fixed numeric types. Finally, it loosens the restriction for opArithmetic to only work for equal Variant types.