Tried the following:
| | |_| | | | (_| | | Version 0.6.0 (2017-06-19 13:05 UTC)
_/ |\__'_|_|_|\__'_| |
|__/ | x86_64-redhat-linux
julia> union(Set(Int16[1,2,3]), IntSet([1,42]))
4-element Array{Int64,1}:
2
3
1
42
julia> intersect(Set(Int16[1,2,3]), IntSet([1,42]))
1-element Array{Int64,1}:
1
and was confused, why didn’t I see a Set, or IntSet but a Vector?
Interchanging the arguments helped, so that seemed not a design decision.
julia> intersect(IntSet([1,42]), Set(Int16[1,2,3]))
IntSet([1])
I found the bugs in base/set.jl:54 and :69
function union(s::Set, sets::Set...)
I think, the second Set
should be AbstractSet
there, otherwise the method falls back to
intersect(v1, vs...) in Base at array.jl:1854
which is responsible for the Array
return type.