I have this class that takes a a varargs parameter and a key in the primary constructor, and a secondary constructor that only requires the key, then, when calling the primary constructor,
I just pass an empty Array and spread it *emptyArray<String>.
class AppendableParameter(val key: String, vararg parameters: String) {
constructor(key: String) : this(key, *emptyArray<String>())
}
The code works fine, but IntelliJ gives me a warning:
Remove redundant spread operator
If i do remove it though, it will not work as it'd be expecting a String, and the "suggested fix"
from IntelliJ just deletes the parameter, making the constructor call invalid.
Is this possibly a bug in IntelliJ's system, or am I missing something trivial?