As we know (mentioned in this question, countless people writing the same answer), we can have extension methods for companion objects to make something look like a "static extension".
But when I tried this on kotlin.Array
, I failed:
operator fun <T> Array<T>.Companion.invoke() {
}
The code above causes this error:
So does Array
s have companion objects? If no, how can I make "static extension"s for Array
s?
Edit:
inline operator fun <reified T> Array<T>.Companion.invoke() {
}
This code fails, too.