assertk icon indicating copy to clipboard operation
assertk copied to clipboard

Change signature for `containsAll()`

Open evant opened this issue 8 years ago • 6 comments

right now it's containsAll(vararg Any?) which it makes it too easy to accidentally pass in listOf(foo) instead of *listOf(foo)

evant avatar May 01 '17 15:05 evant

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)

rf43 avatar May 05 '17 00:05 rf43

Hm good point, maybe a separate collection overload?

evant avatar May 05 '17 13:05 evant

Looks like this is impossible without https://youtrack.jetbrains.com/issue/KT-13198

evant avatar May 27 '17 17:05 evant

Looks like a blocker. Can't think of a way around this 😕

nishtahir avatar Jun 02 '17 18:06 nishtahir

containsAll(*listOf(...)) doesn't event work for me. Need to put .toTypedArray() on the end too. Deal-breaker. :(

GrahamLea avatar May 06 '18 11:05 GrahamLea