I really love kotlin, some of the language features and design solutions are magnificent, it is one of the nicest languages I’ve ever worked with. But there is one design feature in kotlin that makes me wonder.

Why doesn’t `Number`

class (supertype of all primitive numbers in kotlin) override mathematical operators like plus, minus or multiplication? Every its ancestor overrides them - and it is very logical, those operations are for sure defined for all number types.

My case is: I’d like to implement a custom realization of vector, a pair of numbers, with some custom methods. I’d also like this vector to be a template class, so it would be possible to create a vector of integers or a vector of floating point numbers. But it is actually impossible (afaik) in kotlin just because in that case there is no guarantee those primitive mathematical operators would be available.

Example code:

```
class Vector <Type: Number> (var x: Type, var y: Type) {
operator fun minus (other: Vector<Type>) = Vector(x - other.x, y - other.y)
operator fun plus (other: Vector<Type>) = Vector(x + other.x, y + other.y)
}
```

That code won’t compile. But it seems to me that it would be more logical if it would!

Is there any general solution to that kind of problems?