{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/17228","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/17228/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/17228/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/17228/events","html_url":"https://github.com/JuliaLang/julia/pull/17228","id":163418336,"number":17228,"title":"Make unvetted `size` throw an error for arrays with non-1 indexing","user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-07-01T15:21:46Z","updated_at":"2016-07-04T17:02:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/17228","html_url":"https://github.com/JuliaLang/julia/pull/17228","diff_url":"https://github.com/JuliaLang/julia/pull/17228.diff","patch_url":"https://github.com/JuliaLang/julia/pull/17228.patch"},"body":"For arrays that violate the assumption that indexing starts at 1, there's a risk that formerly-safe code could exit with nasty errors, see [here](https://github.com/JuliaLang/julialang.github.com/blob/52b20d2f1a2c39d0ea8c4abbc05dba2bd4b454e5/blog/_posts/2016-06-12-offset-arrays.md#avoiding-segfaults). Discussion in #16260 led to a good suggestion for a migration strategy: during julia-0.5, `size` should throw an error by default for such \"unconventional\" arrays. This PR introduces the necessary infrastructure:\r\n- an `IndicesSafety` trait that can be passed as an argument through `size` and related functions\r\n- a macro `@safeindices` that you can use to wrap functions that you've certified are safe for arrays with unconventional indices.\r\n\r\nTogether with #17137, this closes #16973 and should be the end of array changes that I envision for 0.5. (It is expected that more functions will become `@safeindices` over 0.5.x releases as people increasingly use such unconventional arrays.)\r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/230328262","html_url":"https://github.com/JuliaLang/julia/pull/17228#issuecomment-230328262","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/17228","id":230328262,"user":{"login":"KristofferC","id":1282691,"avatar_url":"https://avatars.githubusercontent.com/u/1282691?v=3","gravatar_id":"","url":"https://api.github.com/users/KristofferC","html_url":"https://github.com/KristofferC","followers_url":"https://api.github.com/users/KristofferC/followers","following_url":"https://api.github.com/users/KristofferC/following{/other_user}","gists_url":"https://api.github.com/users/KristofferC/gists{/gist_id}","starred_url":"https://api.github.com/users/KristofferC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristofferC/subscriptions","organizations_url":"https://api.github.com/users/KristofferC/orgs","repos_url":"https://api.github.com/users/KristofferC/repos","events_url":"https://api.github.com/users/KristofferC/events{/privacy}","received_events_url":"https://api.github.com/users/KristofferC/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T17:02:02Z","updated_at":"2016-07-04T17:02:02Z","body":"@nanosoldier `runbenchmarks(ALL, vs=\":master\")`"}}
{"actor":{"display_login":"KristofferC"}}