Might it be possible to create a spread operator f...
# announcements
d
Might it be possible to create a spread operator for my own class? Lets say I have a class
Operands : List<Operand>
and I want to spread it with
*operands
instead of
*operands.toTypedArray()
which I have to use now
r
No, the spread operator cannot be overloaded. The documentation has an exhaustive list of overloadable operators: https://kotlinlang.org/docs/reference/operator-overloading.html
If you want to propose it, you could try in #C0B9K7EP2, though I'm pretty sure it has been shot down before (though I can't recall exactly why)
d
Thank you for your answer! Totally fair when you know when its not overloadable. 🙂