{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/18713","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/18713/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/18713/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/18713/events","html_url":"https://github.com/JuliaLang/julia/issues/18713","id":179767649,"number":18713,"title":"Mapping of Dicts: How to interpret error message?","user":{"login":"stefan-m-lenz","id":13000259,"avatar_url":"https://avatars.githubusercontent.com/u/13000259?v=3","gravatar_id":"","url":"https://api.github.com/users/stefan-m-lenz","html_url":"https://github.com/stefan-m-lenz","followers_url":"https://api.github.com/users/stefan-m-lenz/followers","following_url":"https://api.github.com/users/stefan-m-lenz/following{/other_user}","gists_url":"https://api.github.com/users/stefan-m-lenz/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-m-lenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-m-lenz/subscriptions","organizations_url":"https://api.github.com/users/stefan-m-lenz/orgs","repos_url":"https://api.github.com/users/stefan-m-lenz/repos","events_url":"https://api.github.com/users/stefan-m-lenz/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-m-lenz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/error%20handling","name":"error handling","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-28T13:07:53Z","updated_at":"2016-09-28T21:30:32Z","closed_at":null,"body":"I have the following code snippet, that works in Julia 0.4:\r\n\r\n    d = Dict(1 => 2, 3 => 4)\r\n    map(kv -> (kv[1], kv[2]^2), d)\r\n\r\nIn Julia 0.5.0, this gives me the following error message, which I don't understand:\r\n\r\n    ERROR: ArgumentError: for Associatives, similar requires an element type of Pair;\r\n      if calling map, consider a comprehension instead\r\n     in _collect(::Dict{Int64,Int64}, ::Base.Generator{Dict{Int64,Int64},##65#66}, ::Base.EltypeUnknown,  ::Base.HasLength) at .\\array.jl:321\r\n     in map(::Function, ::Dict{Int64,Int64}) at .\\abstractarray.jl:1683\r\n\r\nWhy did this cease to work? How can I understand the error message?\r\n\r\nThe following works in 0.4 and 0.5 and prints two times \"`Pair{Int64,Int64}`\":\r\n\r\n    for kv in d\r\n        println(typeof(kv))\r\n    end\r\n\r\nIf I can still iterate over the the dictionary and get key-value pairs, so why can't I map them?\r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/250306754","html_url":"https://github.com/JuliaLang/julia/issues/18713#issuecomment-250306754","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/18713","id":250306754,"user":{"login":"ararslan","id":6396159,"avatar_url":"https://avatars.githubusercontent.com/u/6396159?v=3","gravatar_id":"","url":"https://api.github.com/users/ararslan","html_url":"https://github.com/ararslan","followers_url":"https://api.github.com/users/ararslan/followers","following_url":"https://api.github.com/users/ararslan/following{/other_user}","gists_url":"https://api.github.com/users/ararslan/gists{/gist_id}","starred_url":"https://api.github.com/users/ararslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ararslan/subscriptions","organizations_url":"https://api.github.com/users/ararslan/orgs","repos_url":"https://api.github.com/users/ararslan/repos","events_url":"https://api.github.com/users/ararslan/events{/privacy}","received_events_url":"https://api.github.com/users/ararslan/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T21:30:32Z","updated_at":"2016-09-28T21:30:32Z","body":"@timholy I think the error is perfectly clear coming from `similar`, I just think it's not so obvious when it comes out of `map` instead. Not sure how best to address that."}}
{"actor":{"display_login":"ararslan"}}