{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/27316","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/27316/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/27316/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/27316/events","html_url":"https://github.com/JuliaLang/julia/issues/27316","id":327623486,"number":27316,"title":"Hang during inference","user":{"login":"jekbradbury","id":11729078,"avatar_url":"https://avatars2.githubusercontent.com/u/11729078?v=4","gravatar_id":"","url":"https://api.github.com/users/jekbradbury","html_url":"https://github.com/jekbradbury","followers_url":"https://api.github.com/users/jekbradbury/followers","following_url":"https://api.github.com/users/jekbradbury/following{/other_user}","gists_url":"https://api.github.com/users/jekbradbury/gists{/gist_id}","starred_url":"https://api.github.com/users/jekbradbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jekbradbury/subscriptions","organizations_url":"https://api.github.com/users/jekbradbury/orgs","repos_url":"https://api.github.com/users/jekbradbury/repos","events_url":"https://api.github.com/users/jekbradbury/events{/privacy}","received_events_url":"https://api.github.com/users/jekbradbury/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-30T08:21:59Z","updated_at":"2018-05-30T14:31:38Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Will update the title if/when someone figures out what the root cause is...\r\n\r\nThis code (reduced from metaprogramming for [FunctionalControlFlow.jl](https://github.com/jekbradbury/FunctionalControlFlow.jl)) leads to an hang somewhere in inference (on macOS and Linux not even ^\\ can kill it):\r\n\r\n```\r\nisexpr(x, ts...) = any(T->isa(T, Type) && isa(x, T), ts)\r\n\r\nfunction f1(x)\r\n    isexpr(x, Symbol) && return [x]\r\n    x.head == :(.) && return [x.args[2]]\r\n    return Symbol[]\r\nend\r\n\r\nf2(x, params::Vector) = x\r\nfunction f2(x1, x2)\r\n    params = f1(x1)\r\n    return f2(x1, params), f2(x2, params)\r\nend\r\n\r\n@code_typed f2(Expr(:a), Expr(:b))\r\n```\r\n\r\nCan probably be reduced further, but every obvious change from here makes it go away.\r\n\r\nEdit: Tested on today's nightly, 0.7.0-DEV.5245 / Commit fb0d289814 (0 days old master) on macOS, as well as the nightly from 6 days ago, 0.7.0-DEV.5187 / Commit 13b2f2be52 (6 days old master) on Linux."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/393184840","html_url":"https://github.com/JuliaLang/julia/issues/27316#issuecomment-393184840","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/27316","id":393184840,"user":{"login":"martinholters","id":15785210,"avatar_url":"https://avatars0.githubusercontent.com/u/15785210?v=4","gravatar_id":"","url":"https://api.github.com/users/martinholters","html_url":"https://github.com/martinholters","followers_url":"https://api.github.com/users/martinholters/followers","following_url":"https://api.github.com/users/martinholters/following{/other_user}","gists_url":"https://api.github.com/users/martinholters/gists{/gist_id}","starred_url":"https://api.github.com/users/martinholters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinholters/subscriptions","organizations_url":"https://api.github.com/users/martinholters/orgs","repos_url":"https://api.github.com/users/martinholters/repos","events_url":"https://api.github.com/users/martinholters/events{/privacy}","received_events_url":"https://api.github.com/users/martinholters/received_events","type":"User","site_admin":false},"created_at":"2018-05-30T14:31:38Z","updated_at":"2018-05-30T14:31:38Z","author_association":"MEMBER","body":"More specifically, this seems to hang on\r\nhttps://github.com/JuliaLang/julia/blob/b9c6cd054a30e52d7d4be9cf0e6c7742d6b22588/base/compiler/typelattice.jl#L138\r\nfor\r\n```julia\r\na=Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}}}}}\r\nb=Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}, Union{Nothing, Tuple{Union{Nothing, Tuple{Nothing, Nothing}}, Union{Nothing, Tuple{Nothing, Nothing}}}}}}}}}}}}}}\r\n```\r\nI'm not sure subtyping can be made to answer that in a reasonable amount of time, but probably, inference should limit these types."}}
{"actor":{"display_login":"martinholters"}}