{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/26779","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/26779/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/26779/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/26779/events","html_url":"https://github.com/JuliaLang/julia/issues/26779","id":313334393,"number":26779,"title":"ERROR: no promotion exists for MyInt and Int64","user":{"login":"dlfivefifty","id":1229737,"avatar_url":"https://avatars3.githubusercontent.com/u/1229737?v=4","gravatar_id":"","url":"https://api.github.com/users/dlfivefifty","html_url":"https://github.com/dlfivefifty","followers_url":"https://api.github.com/users/dlfivefifty/followers","following_url":"https://api.github.com/users/dlfivefifty/following{/other_user}","gists_url":"https://api.github.com/users/dlfivefifty/gists{/gist_id}","starred_url":"https://api.github.com/users/dlfivefifty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlfivefifty/subscriptions","organizations_url":"https://api.github.com/users/dlfivefifty/orgs","repos_url":"https://api.github.com/users/dlfivefifty/repos","events_url":"https://api.github.com/users/dlfivefifty/events{/privacy}","received_events_url":"https://api.github.com/users/dlfivefifty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-11T13:53:17Z","updated_at":"2018-04-11T14:01:51Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The behaviour below seems inconsistent, and I couldn't find any documentation on why this is correct.  Perhaps it's a case of a `Number` interface in the docs is needed?\r\n\r\n```julia\r\njulia> struct MyInt <: Integer \r\n       x::Int\r\n       end\r\n\r\njulia> promote_type(MyInt, Int) # Why not Integer?\r\nERROR: no promotion exists for MyInt and Int64\r\nStacktrace:\r\n [1] error(::String, ::Type, ::String, ::Type) at ./error.jl:42\r\n [2] promote_to_supertype at ./promotion.jl:294 [inlined]\r\n [3] promote_result at ./promotion.jl:285 [inlined]\r\n [4] promote_type(::Type{MyInt}, ::Type{Int64}) at ./promotion.jl:220\r\n [5] top-level scope\r\n\r\njulia> promote_type(MyInt, Vector)\r\nAny\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/380462941","html_url":"https://github.com/JuliaLang/julia/issues/26779#issuecomment-380462941","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/26779","id":380462941,"user":{"login":"dlfivefifty","id":1229737,"avatar_url":"https://avatars3.githubusercontent.com/u/1229737?v=4","gravatar_id":"","url":"https://api.github.com/users/dlfivefifty","html_url":"https://github.com/dlfivefifty","followers_url":"https://api.github.com/users/dlfivefifty/followers","following_url":"https://api.github.com/users/dlfivefifty/following{/other_user}","gists_url":"https://api.github.com/users/dlfivefifty/gists{/gist_id}","starred_url":"https://api.github.com/users/dlfivefifty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlfivefifty/subscriptions","organizations_url":"https://api.github.com/users/dlfivefifty/orgs","repos_url":"https://api.github.com/users/dlfivefifty/repos","events_url":"https://api.github.com/users/dlfivefifty/events{/privacy}","received_events_url":"https://api.github.com/users/dlfivefifty/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T14:01:51Z","updated_at":"2018-04-11T14:01:51Z","author_association":"CONTRIBUTOR","body":"To clarify, I don't think this should error out:\r\n```julia\r\n\r\njulia> [MyInt(5),4]\r\nERROR: no promotion exists for MyInt and Int64\r\nStacktrace:\r\n [1] error(::String, ::Type, ::String, ::Type) at ./error.jl:42\r\n [2] promote_to_supertype at ./promotion.jl:294 [inlined]\r\n [3] promote_result at ./promotion.jl:285 [inlined]\r\n [4] promote_type at ./promotion.jl:220 [inlined]\r\n [5] promote_typeof(::MyInt, ::Int64, ::Vararg{Int64,N} where N) at ./promotion.jl:263\r\n [6] vect(::MyInt, ::Vararg{Any,N} where N) at ./array.jl:104\r\n [7] top-level scope\r\n```\r\nMaybe `vect` needs to call `typejoin`, not `promote_type`?"}}
{"actor":{"display_login":"dlfivefifty"}}