Have number types extend from a common type #4572
Replies: 2 comments 1 reply
-
If this was feasible without shapes/extensions, it would have been done already. |
Beta Was this translation helpful? Give feedback.
-
The runtime team experimented with this a while ago, by adding an |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Applying generic constraints for "numeric" values are impossible, so I would propose that int, decimal, short, (and all the other numeric types), is implementing a common interface, something like "INumericValueBase", that doesn't have to do anything except allowing for a generic constraint, (Something(T value) where T : INumericValueBase)
I know Mads have some very complicated proposal for something that will give this, but I prefer KISS-principled solutions
Beta Was this translation helpful? Give feedback.
All reactions