{"action":"opened","number":460,"pull_request":{"url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/460","id":199172824,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MTcyODI0","html_url":"https://github.com/JuliaArrays/StaticArrays.jl/pull/460","diff_url":"https://github.com/JuliaArrays/StaticArrays.jl/pull/460.diff","patch_url":"https://github.com/JuliaArrays/StaticArrays.jl/pull/460.patch","issue_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues/460","number":460,"state":"open","locked":false,"title":"Add explicit fallback for Tuple(::StaticArray) which calls convert","user":{"login":"schmrlng","id":4130030,"node_id":"MDQ6VXNlcjQxMzAwMzA=","avatar_url":"https://avatars0.githubusercontent.com/u/4130030?v=4","gravatar_id":"","url":"https://api.github.com/users/schmrlng","html_url":"https://github.com/schmrlng","followers_url":"https://api.github.com/users/schmrlng/followers","following_url":"https://api.github.com/users/schmrlng/following{/other_user}","gists_url":"https://api.github.com/users/schmrlng/gists{/gist_id}","starred_url":"https://api.github.com/users/schmrlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmrlng/subscriptions","organizations_url":"https://api.github.com/users/schmrlng/orgs","repos_url":"https://api.github.com/users/schmrlng/repos","events_url":"https://api.github.com/users/schmrlng/events{/privacy}","received_events_url":"https://api.github.com/users/schmrlng/received_events","type":"User","site_admin":false},"body":"Fixes #446. The issue seems to be that `Tuple(::StaticArray)` does not fall back to `convert` as defined in the lines above this proposed change (see below) so one fix is to make that fallback explicit.\r\n```julia\r\n  | | |_| | | | (_| |  |  Version 0.7.0-beta.125 (2018-07-02 20:55 UTC)\r\n _/ |\\__'_|_|_|\\__'_|  |  Commit c5bf467361 (1 day old master)\r\n|__/                   |  x86_64-linux-gnu\r\n\r\njulia> using BenchmarkTools, StaticArrays\r\n\r\njulia> struct Point3D <: FieldVector{3, Float64}\r\n           x::Float64\r\n           y::Float64\r\n           z::Float64\r\n       end\r\n\r\njulia> p = rand(Point3D)\r\n3-element Point3D:\r\n 0.6628326877139248\r\n 0.14765795872117993\r\n 0.48470441802594144\r\n\r\njulia> @benchmark Point3D($p)\r\nBenchmarkTools.Trial:\r\n  memory estimate:  224 bytes\r\n  allocs estimate:  6\r\n  --------------\r\n  minimum time:     342.486 ns (0.00% GC)\r\n  median time:      355.670 ns (0.00% GC)\r\n  mean time:        387.416 ns (7.73% GC)\r\n  maximum time:     144.887 μs (99.70% GC)\r\n  --------------\r\n  samples:          10000\r\n  evals/sample:     212\r\n\r\njulia> @which Tuple(p)\r\n(::Type{T})(itr) where T<:Tuple in Base at tuple.jl:242\r\n\r\njulia> @inline Tuple(a::StaticArray) = convert(Tuple, a)\r\nTuple\r\n\r\njulia> @benchmark Point3D($p)\r\nBenchmarkTools.Trial:\r\n  memory estimate:  0 bytes\r\n  allocs estimate:  0\r\n  --------------\r\n  minimum time:     1.302 ns (0.00% GC)\r\n  median time:      1.312 ns (0.00% GC)\r\n  mean time:        1.312 ns (0.00% GC)\r\n  maximum time:     17.192 ns (0.00% GC)\r\n  --------------\r\n  samples:          10000\r\n  evals/sample:     1000\r\n\r\n```","created_at":"2018-07-04T08:21:38Z","updated_at":"2018-07-04T08:21:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/460/commits","review_comments_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/460/comments","review_comment_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues/460/comments","statuses_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/statuses/7c5f2cf482a2e1f6061ed9c75239c22277c69707","head":{"label":"schmrlng:tuple_convert","ref":"tuple_convert","sha":"7c5f2cf482a2e1f6061ed9c75239c22277c69707","user":{"login":"schmrlng","id":4130030,"node_id":"MDQ6VXNlcjQxMzAwMzA=","avatar_url":"https://avatars0.githubusercontent.com/u/4130030?v=4","gravatar_id":"","url":"https://api.github.com/users/schmrlng","html_url":"https://github.com/schmrlng","followers_url":"https://api.github.com/users/schmrlng/followers","following_url":"https://api.github.com/users/schmrlng/following{/other_user}","gists_url":"https://api.github.com/users/schmrlng/gists{/gist_id}","starred_url":"https://api.github.com/users/schmrlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmrlng/subscriptions","organizations_url":"https://api.github.com/users/schmrlng/orgs","repos_url":"https://api.github.com/users/schmrlng/repos","events_url":"https://api.github.com/users/schmrlng/events{/privacy}","received_events_url":"https://api.github.com/users/schmrlng/received_events","type":"User","site_admin":false},"repo":{"id":135509259,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU1MDkyNTk=","name":"StaticArrays.jl","full_name":"schmrlng/StaticArrays.jl","owner":{"login":"schmrlng","id":4130030,"node_id":"MDQ6VXNlcjQxMzAwMzA=","avatar_url":"https://avatars0.githubusercontent.com/u/4130030?v=4","gravatar_id":"","url":"https://api.github.com/users/schmrlng","html_url":"https://github.com/schmrlng","followers_url":"https://api.github.com/users/schmrlng/followers","following_url":"https://api.github.com/users/schmrlng/following{/other_user}","gists_url":"https://api.github.com/users/schmrlng/gists{/gist_id}","starred_url":"https://api.github.com/users/schmrlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmrlng/subscriptions","organizations_url":"https://api.github.com/users/schmrlng/orgs","repos_url":"https://api.github.com/users/schmrlng/repos","events_url":"https://api.github.com/users/schmrlng/events{/privacy}","received_events_url":"https://api.github.com/users/schmrlng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schmrlng/StaticArrays.jl","description":"Statically sized arrays for Julia","fork":true,"url":"https://api.github.com/repos/schmrlng/StaticArrays.jl","forks_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/forks","keys_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/teams","hooks_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/hooks","issue_events_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/issues/events{/number}","events_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/events","assignees_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/assignees{/user}","branches_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/branches{/branch}","tags_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/tags","blobs_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/languages","stargazers_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/stargazers","contributors_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/contributors","subscribers_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/subscribers","subscription_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/subscription","commits_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/contents/{+path}","compare_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/merges","archive_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/downloads","issues_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/issues{/number}","pulls_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/labels{/name}","releases_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/releases{/id}","deployments_url":"https://api.github.com/repos/schmrlng/StaticArrays.jl/deployments","created_at":"2018-05-30T23:57:59Z","updated_at":"2018-05-30T23:58:01Z","pushed_at":"2018-07-04T08:09:54Z","git_url":"git://github.com/schmrlng/StaticArrays.jl.git","ssh_url":"git@github.com:schmrlng/StaticArrays.jl.git","clone_url":"https://github.com/schmrlng/StaticArrays.jl.git","svn_url":"https://github.com/schmrlng/StaticArrays.jl","homepage":"","size":1007,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaArrays:master","ref":"master","sha":"e5bd424e172196056812d86b7caeed42bd52382b","user":{"login":"JuliaArrays","id":21312771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMzEyNzcx","avatar_url":"https://avatars0.githubusercontent.com/u/21312771?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaArrays","html_url":"https://github.com/JuliaArrays","followers_url":"https://api.github.com/users/JuliaArrays/followers","following_url":"https://api.github.com/users/JuliaArrays/following{/other_user}","gists_url":"https://api.github.com/users/JuliaArrays/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaArrays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaArrays/subscriptions","organizations_url":"https://api.github.com/users/JuliaArrays/orgs","repos_url":"https://api.github.com/users/JuliaArrays/repos","events_url":"https://api.github.com/users/JuliaArrays/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaArrays/received_events","type":"Organization","site_admin":false},"repo":{"id":58931685,"node_id":"MDEwOlJlcG9zaXRvcnk1ODkzMTY4NQ==","name":"StaticArrays.jl","full_name":"JuliaArrays/StaticArrays.jl","owner":{"login":"JuliaArrays","id":21312771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMzEyNzcx","avatar_url":"https://avatars0.githubusercontent.com/u/21312771?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaArrays","html_url":"https://github.com/JuliaArrays","followers_url":"https://api.github.com/users/JuliaArrays/followers","following_url":"https://api.github.com/users/JuliaArrays/following{/other_user}","gists_url":"https://api.github.com/users/JuliaArrays/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaArrays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaArrays/subscriptions","organizations_url":"https://api.github.com/users/JuliaArrays/orgs","repos_url":"https://api.github.com/users/JuliaArrays/repos","events_url":"https://api.github.com/users/JuliaArrays/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaArrays/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaArrays/StaticArrays.jl","description":"Statically sized arrays for Julia","fork":false,"url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl","forks_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/forks","keys_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/teams","hooks_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/events","assignees_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/tags","blobs_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/subscription","commits_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/merges","archive_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/downloads","issues_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/deployments","created_at":"2016-05-16T12:45:37Z","updated_at":"2018-07-02T23:27:05Z","pushed_at":"2018-07-04T01:14:44Z","git_url":"git://github.com/JuliaArrays/StaticArrays.jl.git","ssh_url":"git@github.com:JuliaArrays/StaticArrays.jl.git","clone_url":"https://github.com/JuliaArrays/StaticArrays.jl.git","svn_url":"https://github.com/JuliaArrays/StaticArrays.jl","homepage":"","size":1113,"stargazers_count":136,"watchers_count":136,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":76,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":45,"open_issues":76,"watchers":136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/460"},"html":{"href":"https://github.com/JuliaArrays/StaticArrays.jl/pull/460"},"issue":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues/460"},"comments":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/issues/460/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/460/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/pulls/460/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaArrays/StaticArrays.jl/statuses/7c5f2cf482a2e1f6061ed9c75239c22277c69707"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":1,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"schmrlng"}}