I’m not new to Julia, but am new to using Sets. The following MWE puzzles me (the autosearch for related topics reference some 2017 queries which aren’t relevant, AFAICS):
julia> x = Set((1,2)); y = Set(('a', 'b')); union!(y,x)
ERROR: TypeError: 2 is not a valid key for type Char
Stacktrace:
[1] setindex!(h::Dict{Char, Nothing}, v0::Nothing, key0::Int64)
@ Base ./dict.jl:348
[2] push!(s::Set{Char}, x::Int64)
@ Base ./set.jl:137
[3] union!(s::Set{Char}, itr::Set{Int64})
@ Base ./abstractset.jl:106
[4] top-level scope
@ REPL[272]:1
julia> x = Set{Any}((1,2)); y = Set{Any}(('a', 'b')); union!(y,x)
Set{Any} with 4 elements:
2
'a'
'b'
1
Should I have expected this?