I've got a question. I have the following class: ...
# getting-started
r
I've got a question. I have the following class:
Copy code
class RuleList(vararg val rules: Rule) {
    fun refune(rule: Rule) = RuleList(*(rules + rule))
}
but I'm getting an error on the
rules + rule
part (saying none of the
Array<T>.plus()
functions are applicable). Am I correct in assuming this is because a
vararg
is declared as
Array<out T>
instead of
Array<T>
? Is there an easy way around this?