I want to create extension functions for classes that encapsulate simple Number
s. For example DoubleProperty
. I encountered the problem, that I can\'t
You cannot overload both +
and +=
. Overload one of the them.
When you write += in your code, theoretically both plus the plusAssign functions can be called (see figure 7.2). If this is the case, and both functions are defined and applicable, the compiler reports an error.
I copied/pasted from Kotlin in Action book!