Skip to content

make Bool <: Unsigned (i.e. UInt1) #19168

Closed
@StefanKarpinski

Description

@StefanKarpinski

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.

Metadata

Metadata

Assignees

Labels

help wantedIndicates that a maintainer wants help on an issue or pull requestneeds decisionA decision on this change is needed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions