Change signature for `containsAll()`
evant opened this issue · 5 comments
right now it's containsAll(vararg Any?)
which it makes it too easy to accidentally pass in listOf(foo)
instead of *listOf(foo)
Just curious about this... we could just have it throw an error (as it currently does). I could add another test to ensure that this behavior is kept and consistent.
Also, iirc - for now Kotlin only supports the spread operator for arrays *arrayOf(foo)
and not collections like lists *listOf(foo)
Hm good point, maybe a separate collection overload?
Looks like this is impossible without https://youtrack.jetbrains.com/issue/KT-13198
Looks like a blocker. Can't think of a way around this 😕
containsAll(*listOf(...))
doesn't event work for me. Need to put .toTypedArray()
on the end too. Deal-breaker. :(