Reputation: 3
I see that kotlin does not support this:
fun testDefaultListArg(listArg:MutableList<String>=mutableListOf()) {
...
}
Is there a way to make listArg parameter accepte a default list instance value ?
Thanks
Upvotes: 0
Views: 53
Reputation: 18558
To turn the comment given by JBNizet into an answer:
You have to put spaces before and after the equal (=
) sign, like this:
fun testDefaultListArg(listArg: MutableList<String> = mutableListOf()) {
// do what you think you have to do here
}
Upvotes: 2