Closed
Description
Original title: "make Bool
not a subtype of Number
"
C.f. #18367. I propose simply changing the type hierarchy so that Bool
is not a subtype of Number
since it is so often an exceptional case. We could still keep useful arithmetic behaviors like true + true == 2
, etc. – arithmetic need not only work for numbers. Once upon a time UInt8
+ UInt8
produced an Int
, but that's no longer the case, so now Bool
is the "odd man out". If we make !(Bool <: Number)
then we can at least make the behavior of Number
completely consistent.