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

Warning for simple Dict on 0.5-rc3 #18213

Closed
rened opened this issue Aug 24, 2016 · 3 comments
Closed

Warning for simple Dict on 0.5-rc3 #18213

rened opened this issue Aug 24, 2016 · 3 comments

Comments

@rened
Copy link
Member

rened commented Aug 24, 2016

I get the following warning for an (I believe?) innocent Dict:

  | | |_| | | | (_| |  |  Version 0.5.0-rc3+0 (2016-08-22 23:43 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-apple-darwin15.6.0

julia> Dict(1 => rand(2,3), 'c' => "asdf")
WARNING: x::Char == y::Integer is deprecated, use UInt32(x) == y instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in ==(::Char, ::Int64) at ./deprecated.jl:50
 in ht_keyindex2(::Dict{Any,Any}, ::Char) at ./dict.jl:580
 in setindex!(::Dict{Any,Any}, ::String, ::Char) at ./dict.jl:635
 in Dict{Any,Any}(::Tuple{Pair{Int64,Array{Float64,2}},Pair{Char,String}}) at ./dict.jl:349
 in Dict{K,V}(::Pair{Int64,Array{Float64,2}}, ::Pair{Char,String}) at ./dict.jl:380
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval(::Module, ::Any) at /Users/rene/local/julia5/usr/lib/julia/sys.dylib:?
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading no file, in expression starting on line 0
Dict{Any,Any} with 2 entries:
  'c' => "asdf"
  1   => [0.874806 0.180844 0.638005; 0.56545 0.0607152 0.509738]
@KristofferC
Copy link
Member

FWIW, I think this depwarn is very annoying and it makes you have to guard code sometimes with !isa(T, Char) && T == 3 if you don't know what T will be.

@martinholters
Copy link
Member

This looks like #265 hitting, though, as ht_keyindex2 only calls === and isequal. But it's probably using the definition isequal(x, y) = x == y from operators.jl instead of isequal(x::Char, y::Integer) = false from deprecated.jl. Should we move the latter into operators.jl?

@martinholters
Copy link
Member

Confirmed: moving the specialized isequal definitions into operators.jl fixes the issue.

martinholters added a commit that referenced this issue Aug 25, 2016
martinholters added a commit that referenced this issue Aug 25, 2016
martinholters added a commit that referenced this issue Aug 25, 2016
tkelman pushed a commit that referenced this issue Aug 29, 2016
tkelman pushed a commit that referenced this issue Aug 29, 2016
mfasi pushed a commit to mfasi/julia that referenced this issue Sep 5, 2016
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

3 participants