For example:
common.number.Number.kt:operator fun Int.plus(other: BigInteger): BigInteger {
return BigInteger(this.toString()).add(other)
}
common.test.Test.kt:var i = 1 + BigInteger("1")
Then the Intellij Idea shows an error in class Test.kt.
However, if I add the following import, the error disappears:
import common.number.Number.plus
How can I make IntelliJ Idea import this operator function automatically?
It is need because you make special extension operator. It is working same like extension function. Import required because idea need to know which exactly extension you want using. So extensions can be more then one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With