{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/15938","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/15938/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/15938/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/15938/events","html_url":"https://github.com/JuliaLang/julia/issues/15938","id":149457224,"number":15938,"title":"Variable inferred as Core.Box due to read-only access after definition","user":{"login":"nalimilan","id":1120448,"avatar_url":"https://avatars.githubusercontent.com/u/1120448?v=3","gravatar_id":"","url":"https://api.github.com/users/nalimilan","html_url":"https://github.com/nalimilan","followers_url":"https://api.github.com/users/nalimilan/followers","following_url":"https://api.github.com/users/nalimilan/following{/other_user}","gists_url":"https://api.github.com/users/nalimilan/gists{/gist_id}","starred_url":"https://api.github.com/users/nalimilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalimilan/subscriptions","organizations_url":"https://api.github.com/users/nalimilan/orgs","repos_url":"https://api.github.com/users/nalimilan/repos","events_url":"https://api.github.com/users/nalimilan/events{/privacy}","received_events_url":"https://api.github.com/users/nalimilan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-19T13:08:38Z","updated_at":"2016-04-19T13:13:32Z","closed_at":"2016-04-19T13:10:06Z","body":"With latest git master, in the function below, the type of `len` is inferred correctly, but not `lev` is marked as `Core.Box`. Removing the `ntuple` call fixes this. In 0.4, the types of both variables are inferred correctly.\r\n\r\nFeel free to close if `Core.Box` isn't actually an indication of type instability (I'm merely trusting `@code_warntype` here).\r\n\r\n```julia\r\nfunction f{N}(x::NTuple{N})\r\n    lev = [length(y) for y in x]\r\n    len = [length(y) for y in x]\r\n\r\n    ntuple(i -> length(lev[i]), N)\r\nend\r\n\r\n@code_warntype f((1,2))\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/211919044","html_url":"https://github.com/JuliaLang/julia/issues/15938#issuecomment-211919044","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/15938","id":211919044,"user":{"login":"nalimilan","id":1120448,"avatar_url":"https://avatars.githubusercontent.com/u/1120448?v=3","gravatar_id":"","url":"https://api.github.com/users/nalimilan","html_url":"https://github.com/nalimilan","followers_url":"https://api.github.com/users/nalimilan/followers","following_url":"https://api.github.com/users/nalimilan/following{/other_user}","gists_url":"https://api.github.com/users/nalimilan/gists{/gist_id}","starred_url":"https://api.github.com/users/nalimilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalimilan/subscriptions","organizations_url":"https://api.github.com/users/nalimilan/orgs","repos_url":"https://api.github.com/users/nalimilan/repos","events_url":"https://api.github.com/users/nalimilan/events{/privacy}","received_events_url":"https://api.github.com/users/nalimilan/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T13:13:32Z","updated_at":"2016-04-19T13:13:32Z","body":"Ah, I had only looked for `Core.Box`, but the name wasn't fully qualified a few weeks ago. At least, this issue will help people doing a simple search as I did."}}