{"action":"opened","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/29242","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/29242/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/29242/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/29242/events","html_url":"https://github.com/JuliaLang/julia/issues/29242","id":361270862,"node_id":"MDU6SXNzdWUzNjEyNzA4NjI=","number":29242,"title":"load/compile-order dependent behavior with @generated","user":{"login":"chethega","id":33899329,"node_id":"MDQ6VXNlcjMzODk5MzI5","avatar_url":"https://avatars2.githubusercontent.com/u/33899329?v=4","gravatar_id":"","url":"https://api.github.com/users/chethega","html_url":"https://github.com/chethega","followers_url":"https://api.github.com/users/chethega/followers","following_url":"https://api.github.com/users/chethega/following{/other_user}","gists_url":"https://api.github.com/users/chethega/gists{/gist_id}","starred_url":"https://api.github.com/users/chethega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chethega/subscriptions","organizations_url":"https://api.github.com/users/chethega/orgs","repos_url":"https://api.github.com/users/chethega/repos","events_url":"https://api.github.com/users/chethega/events{/privacy}","received_events_url":"https://api.github.com/users/chethega/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-18T12:03:55Z","updated_at":"2018-09-18T12:03:55Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I think [https://github.com/JuliaArrays/StaticArrays.jl/issues/497](https://github.com/JuliaArrays/StaticArrays.jl/issues/497) is really a bug in julia. This might be a dup with [https://github.com/JuliaLang/julia/issues/28342](https://github.com/JuliaLang/julia/issues/28342) and the issues referenced in there; I honestly can't tell. Unfortunately I don't have a small example, but reproduce by:\r\n```\r\njulia> using StaticArrays\r\n\r\njulia> import StaticArrays.SMatrix, StaticArrays.promote_tuple_eltype\r\n\r\njulia> @generated function (::Type{SMatrix{S1,S2}})(x::NTuple{L,Any}) where {S1,S2,L} #copied verbatim from StaticArrays src\r\n           T = promote_tuple_eltype(x)\r\n\r\n           return quote\r\n               $(Expr(:meta, :inline))\r\n               SMatrix{S1, S2, $T, L}(x)\r\n           end\r\n       end\r\n\r\njulia> using ForwardDiff\r\n\r\njulia> x = ForwardDiff.Dual(1.0); tup=(x, 1);\r\n\r\njulia> @which SMatrix{2,1}(tup)\r\n(::Type{SArray{Tuple{S1,S2},T,2,L} where L where T})(x::Tuple{Vararg{Any,L}}) where {S1, S2, L} in Main at REPL[3]:2\r\n\r\njulia> SMatrix{2,1}(tup)\r\n2×1 SArray{Tuple{2,1},Real,2,2}:\r\n Dual{Nothing}(1.0)\r\n               1   \r\n\r\njulia> @generated function (::Type{SMatrix{S1,S2}})(x::NTuple{L,Any}) where {S1,S2,L}\r\n           T = promote_tuple_eltype(x)\r\n\r\n           return quote\r\n               $(Expr(:meta, :inline))\r\n               SMatrix{S1, S2, $T, L}(x)\r\n           end\r\n       end\r\n\r\njulia> SMatrix{2,1}(tup)\r\n2×1 SArray{Tuple{2,1},ForwardDiff.Dual{Nothing,Float64,0},2,2}:\r\n Dual{Nothing}(1.0)\r\n Dual{Nothing}(1.0)\r\n```\r\n"}}
{"actor":{"display_login":"chethega"}}