Replies: 1 comment
-
There is an interesting article by IBM on flattening inheritance. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
🤔 The problem
The current type system for integer numbers represented by the
Int
number have 2 main flaws:AnyInt
type which is essentially a duplicate of theInt
type already provided by the Kotlin standard libraryAnyInt
are comparable with otherAnyInt
by default, meaning that you can compare twoZeroInt
, which is weird thing to do...💡 The idea
The idea is to flatten the type system for
Int
numbers by replacing theAnyInt
type by a newConvertibleToInt
type, and by removing the inheritance between actual types.This change allows better precision in the API and eases the understanding of numeric types.
🙏 Help needed
Please give this post a reaction if you are interested in this change and comment below your thoughts on it.
We would love to have your feedback!
Beta Was this translation helpful? Give feedback.
All reactions