[julia-users] Re: Dictionary type inference

2016-10-13 Thread Steven G. Johnson
I've filed an issue for further discussion: https://github.com/JuliaLang/julia/issues/18906

[julia-users] Re: Dictionary type inference

2016-10-13 Thread Steven G. Johnson
No, promote_type is working. I think this is intended behavior: if you construct a Dict with keys and/or values of different types, then it will default to using Any. For example: julia> Dict(3=>4, 3.5=>4.5) Dict{Any,Any} with 2 entries: 3 => 4 3.5 => 4.5 This was true in Julia 0.4

[julia-users] Re: Dictionary type inference

2016-10-13 Thread Michele Zaffalon
With one element only, type inference gives: julia> typeof(Dict(sin => sin)) Dict{Base.#sin,Base.#sin} On Thursday, October 13, 2016 at 9:26:37 AM UTC+2, David van Leeuwen wrote: > > Hello, > > I have stumbled across the following type inference issue for `Dict`s in > julia-v0.5: > > julia>