the.bay.news

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

Julia Programming Language
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 ./abst...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.