I am new to kotlin but you made me learn this today, thanks! was using kotlin playground..
You were asking about way to add one more argument with default value without breaking existing calls.
You can do this by using attributes after vararg like
fun foo(
id: String,
vararg values: Int,
attributes: Array<String> = arrayOf("a", "b"),
){
...
}
But wait, that will raise error regarding type, because the attribute which you meant to convey at last of foo() will also be considered as vararg, so to use this code we will have to call the function like:
foo("id_3", 1, 2, 3,attributes=loremipsum)
wherever required you can add ,attributes=loremipsum
and if not leave it.