also, I've got a nasty surprise for anybody who wa...
# announcements
g
also, I've got a nasty surprise for anybody who wants to use a
Set<java.nio.Path>
instance: the code
Copy code
val paths = emptySet<Path>();

paths += Paths.get("/a/b/c")
will result in the
paths
object having three entries,
/a
,
b
, and
c
. This is because
Path
itself extends
Iterable<Path>
, thus, the
+=
overload we hit is this one:
Copy code
public operator fun <T> Set<T>.plus(elements: Iterable<T>): Set<T>
any idea how I can explicitly call the
plus(element: T)
instead of
plus(elements: Iterable<T>)
?
😱 1