{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/19540","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/19540/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/19540/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/19540/events","html_url":"https://github.com/JuliaLang/julia/pull/19540","id":194474774,"number":19540,"title":"type stable last for heterogeneous tuples","user":{"login":"Sacha0","id":5799177,"avatar_url":"https://avatars.githubusercontent.com/u/5799177?v=3","gravatar_id":"","url":"https://api.github.com/users/Sacha0","html_url":"https://github.com/Sacha0","followers_url":"https://api.github.com/users/Sacha0/followers","following_url":"https://api.github.com/users/Sacha0/following{/other_user}","gists_url":"https://api.github.com/users/Sacha0/gists{/gist_id}","starred_url":"https://api.github.com/users/Sacha0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sacha0/subscriptions","organizations_url":"https://api.github.com/users/Sacha0/orgs","repos_url":"https://api.github.com/users/Sacha0/repos","events_url":"https://api.github.com/users/Sacha0/events{/privacy}","received_events_url":"https://api.github.com/users/Sacha0/received_events","type":"User","site_admin":false},"labels":[{"id":171886684,"url":"https://api.github.com/repos/JuliaLang/julia/labels/types%20and%20dispatch","name":"types and dispatch","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-08T23:39:51Z","updated_at":"2016-12-13T08:12:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/19540","html_url":"https://github.com/JuliaLang/julia/pull/19540","diff_url":"https://github.com/JuliaLang/julia/pull/19540.diff","patch_url":"https://github.com/JuliaLang/julia/pull/19540.patch"},"body":"`last` is not type stable for heterogeneous tuples. This pull request provides a specialization of `last` that is type stable for heterogeneous tuples. (Should something like [the trick used to limit code growth in the definition of `map` for tuples](https://github.com/JuliaLang/julia/blob/374c3d6b3c3e15c00f7d3df8b5cb7c8a763aa746/base/tuple.jl#L110) limit inlining here as well?). Best!"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/266673602","html_url":"https://github.com/JuliaLang/julia/pull/19540#issuecomment-266673602","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/19540","id":266673602,"user":{"login":"martinholters","id":15785210,"avatar_url":"https://avatars.githubusercontent.com/u/15785210?v=3","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":"2016-12-13T08:12:36Z","updated_at":"2016-12-13T08:12:36Z","body":"Like so:\r\n```Julia\r\njulia> foo{T<:Tuple}(t::T) = getfield(t, nfields(T))\r\nfoo (generic function with 1 method)\r\n\r\njulia> @code_warntype foo((1, 2.0))\r\nVariables:\r\n  #self#::#foo\r\n  t::Tuple{Int64,Float64}\r\n\r\nBody:\r\n  begin \r\n      return (Main.getfield)(t::Tuple{Int64,Float64},(Main.nfields)($(Expr(:static_parameter, 1)))::Int64)::Float64\r\n  end::Float64\r\n```"}}
{"actor":{"display_login":"martinholters"}}