Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderedDict and OrderedSet constructor does not work properly on variable tuple tupes #67

Closed
yuyichao opened this issue Dec 23, 2014 · 2 comments

Comments

@yuyichao
Copy link
Contributor

Best shown with the example below.

julia> Set{(Symbol...)}([(:a,)])
Set((Symbol...,)[(:a,)])

julia> OrderedSet{(Symbol...)}([(:a,)])
ERROR: `convert` has no method matching convert(::Type{(Symbol...,)}, ::Array{(Symbol,),1})
Closest candidates are:
  convert(::Type{T}, ::T)
  convert(::(Type{T<:Top},Type{T<:Top}...), ::(Any,Any...))
  convert(::Type{Ptr{Void}}, ::Array{T,N})
  ...

 in setindex! at /usr/share/julia/site/v0.4/DataStructures.jl/src/hashdict.jl:366
 in union! at /usr/share/julia/site/v0.4/DataStructures.jl/src/orderedset.jl:31
 in call at /usr/share/julia/site/v0.4/DataStructures.jl/src/orderedset.jl:12

julia> Dict{Symbol, (Symbol...)}(:a => (:a,))
Dict{Symbol,(Symbol...,)} with 1 entry:
  :a => (:a,)

julia> OrderedDict{Symbol, (Symbol...)}(:a => (:a,))
ERROR: `convert` has no method matching convert(::Type{DataStructures.OrderedDict{Symbol,(Symbol...,)}}, ::Pair{Symbol,(Symbol,)})
Closest candidates are:
  convert(::Type{T}, ::T)
  convert(::Type{Nullable{T}}, ::T)
  convert(::Type{Scical.optics.Focus}, ::Any)
  ...

 in call at ./base.jl:34
@kmsquire
Copy link
Member

Thanks for the report. What version of Julia are you running?

I won't be able to get to this until next week, so if you figure out a fix or anyone else has a chance up look at this, a PR would be much appreciated.

kmsquire added a commit that referenced this issue Mar 4, 2015
kmsquire added a commit that referenced this issue Mar 5, 2015
RFC: Update OrderedDict, OrderedSet constructors to take iterables (fixes #50, #64, #67)
@kmsquire
Copy link
Member

kmsquire commented Mar 7, 2015

Fixed in the latest release. Sorry this took so long!

@kmsquire kmsquire closed this as completed Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants