{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/17029","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/17029/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/17029/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/17029/events","html_url":"https://github.com/JuliaLang/julia/issues/17029","id":161233663,"number":17029,"title":"Methods do not always specialize on the function type","user":{"login":"pabloferz","id":8410335,"avatar_url":"https://avatars.githubusercontent.com/u/8410335?v=3","gravatar_id":"","url":"https://api.github.com/users/pabloferz","html_url":"https://github.com/pabloferz","followers_url":"https://api.github.com/users/pabloferz/followers","following_url":"https://api.github.com/users/pabloferz/following{/other_user}","gists_url":"https://api.github.com/users/pabloferz/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloferz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloferz/subscriptions","organizations_url":"https://api.github.com/users/pabloferz/orgs","repos_url":"https://api.github.com/users/pabloferz/repos","events_url":"https://api.github.com/users/pabloferz/events{/privacy}","received_events_url":"https://api.github.com/users/pabloferz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-20T16:10:56Z","updated_at":"2016-06-20T16:36:06Z","closed_at":"2016-06-20T16:17:16Z","body":"I would have thought that the following would work\r\n\r\n```\r\njulia> foo{T<:Integer}(op, ::Type{T}) = \"Fallback\"\r\njulia> foo{T}(::typeof(convert), ::Type{T}) = \"convert\"\r\n```\r\n\r\nbut when running foo(convert, Int) I get an error. Nevertheless the following would have worked in a clean REPL session\r\n\r\n```\r\njulia> foo{T}(op, ::Type{T}) = \"Fallback\"\r\njulia> foo{T}(::typeof(convert), ::Type{T}) = \"convert\"\r\n```\r\n\r\nSo inference works in some cases with the types of methods but not in others or am I missing something?"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/227196626","html_url":"https://github.com/JuliaLang/julia/issues/17029#issuecomment-227196626","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/17029","id":227196626,"user":{"login":"pabloferz","id":8410335,"avatar_url":"https://avatars.githubusercontent.com/u/8410335?v=3","gravatar_id":"","url":"https://api.github.com/users/pabloferz","html_url":"https://github.com/pabloferz","followers_url":"https://api.github.com/users/pabloferz/followers","following_url":"https://api.github.com/users/pabloferz/following{/other_user}","gists_url":"https://api.github.com/users/pabloferz/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloferz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloferz/subscriptions","organizations_url":"https://api.github.com/users/pabloferz/orgs","repos_url":"https://api.github.com/users/pabloferz/repos","events_url":"https://api.github.com/users/pabloferz/events{/privacy}","received_events_url":"https://api.github.com/users/pabloferz/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T16:36:06Z","updated_at":"2016-06-20T16:36:06Z","body":"Ok. I get it, so if I wanted the second to method of the first example to be more specific than the first one I would need `foo{R<:typeof(convert),S}(::R, ::Type{S}) = \"convert\"` right?"}}
{"actor":{"display_login":"pabloferz"}}