3 ms·
One could argue that because the bottom type is a subtype of all other types, it must to implement all the traits that any other type implements. Traits are sim
by GolDDranks 6y ago
One could argue that because the bottom type is a subtype of all other types, it must to implement all the traits that any other type implements. Traits are similar to interfaces in this regard, and it's pretty clear that subtypes must implement the same interfaces their supertypes do. If not, the values of the subtype wouldn't conform to the Liskov substitution principle.
The special case of the bottom type, however, is made possible by the fact that it doesn't have values, so Liskov substitution principle is irrelevant in practice. It's pretty clear, however, that 1) it's kind of weird to do a full reversal on how subtypes work in one case (implements all the traits of the supertypes) versus others (doesn't implement any trait). 2) you want your types to be maximally flexible, so implementing more traits is good, because it allows one to use the type in more situations.