How to write generic functions for all numeric types?

Not being able to write generic functions for the numeric types has been a thorn in the flesh of C# developers for many years as there isn’t even a common super-class or interface for these types

I see. Interesting. I always thought the C# designed things better than in the Java world. Well, then +1 for Kotlin ;-).

I believe it’s a general problem that is not easy to solve. Implicit conversions “in the wild” as in Scala has too drastic consequences that it could be a solution for something. This is just my opinion. I don’t want to spark a discussion on this now …

I once out of interest in Scala defined some new type that can be converted to numeric. I wanted to see whether my new type now also works with sum(). And it didn’t. Spent about 1/2 hour to find out what is missing also searching the Internet, but didn’t manage. Then I gave up, because if its that complicated it simply shouldn’t be that way.