Comment 0 for bug 604823

Revision history for this message
Eike (eike-welk) wrote :

Implement sum types for Siml. Use the bitwise or "|" operator.

Imlpement __or__, __ror__ methods for classes, and let them return sum types.

Sum types can simplify the implementation of mixed arithmetic for example between Float and Quantity.
    func __add__(this: Qty, other: Qty | Float): ...

The __add__ has no need to raise a type exception or return NotImplemented.