Union!() seems to be type-unstable, is this by design?

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?

What in particular is confusing for you?

When Julia choosed type, the types are a mismatch (I didn’t realise that Set elements have all to be of the same type). But had I known, I would have expected promotion, even up to Any.

union!(y,x) means to update y to include the elements of x. But this only works if the set type of y can actually contain those elements (and you cannot change the type of an existing object). Maybe you wanted to use union (without a !):

julia> x = Set((1,2)); y = Set(('a', 'b')); union(y,x)
Set{Any} with 4 elements:
  2
  'a'
  'b'
  1

Thanks, I didn’t quite catch the type issues from reading the docs. There is an art to reading as well as writing them …