{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaStats/NullableArrays.jl/issues/73","labels_url":"https://api.github.com/repos/JuliaStats/NullableArrays.jl/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/JuliaStats/NullableArrays.jl/issues/73/comments","events_url":"https://api.github.com/repos/JuliaStats/NullableArrays.jl/issues/73/events","html_url":"https://github.com/JuliaStats/NullableArrays.jl/issues/73","id":107111153,"number":73,"title":"`isdefined` behavior for `NullableArray`s","user":{"login":"davidagold","id":11862683,"avatar_url":"https://avatars.githubusercontent.com/u/11862683?v=3","gravatar_id":"","url":"https://api.github.com/users/davidagold","html_url":"https://github.com/davidagold","followers_url":"https://api.github.com/users/davidagold/followers","following_url":"https://api.github.com/users/davidagold/following{/other_user}","gists_url":"https://api.github.com/users/davidagold/gists{/gist_id}","starred_url":"https://api.github.com/users/davidagold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidagold/subscriptions","organizations_url":"https://api.github.com/users/davidagold/orgs","repos_url":"https://api.github.com/users/davidagold/repos","events_url":"https://api.github.com/users/davidagold/events{/privacy}","received_events_url":"https://api.github.com/users/davidagold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-18T01:20:35Z","updated_at":"2015-09-18T01:25:08Z","closed_at":null,"body":"This seems wrong to me:\r\n\r\n```julia\r\njulia> Y = NullableArray(Array(Any, 8))\r\n8-element NullableArray{Any,1}:\r\n #undef\r\n #undef\r\n #undef\r\n #undef\r\n #undef\r\n #undef\r\n #undef\r\n #undef\r\n\r\njulia> isdefined(Y, 1)\r\ntrue\r\n\r\njulia> Y[1]\r\nERROR: UndefRefError: access to undefined reference\r\n in getindex at /Users/David/.julia/v0.4/NullableArrays/src/indexing.jl:27\r\n```\r\n\r\nOf course, `isdefined(Y.values, 1)` returns `false`.\r\n\r\nI don't know how to fix this, since `isdefined` isn't a generic function. At the very least we should include a warning somewhere in the documentation that you should only ever rely on calling `isdefined` on the `values` field of a `NullableArray`."},"comment":{"url":"https://api.github.com/repos/JuliaStats/NullableArrays.jl/issues/comments/141301142","html_url":"https://github.com/JuliaStats/NullableArrays.jl/issues/73#issuecomment-141301142","issue_url":"https://api.github.com/repos/JuliaStats/NullableArrays.jl/issues/73","id":141301142,"user":{"login":"davidagold","id":11862683,"avatar_url":"https://avatars.githubusercontent.com/u/11862683?v=3","gravatar_id":"","url":"https://api.github.com/users/davidagold","html_url":"https://github.com/davidagold","followers_url":"https://api.github.com/users/davidagold/followers","following_url":"https://api.github.com/users/davidagold/following{/other_user}","gists_url":"https://api.github.com/users/davidagold/gists{/gist_id}","starred_url":"https://api.github.com/users/davidagold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidagold/subscriptions","organizations_url":"https://api.github.com/users/davidagold/orgs","repos_url":"https://api.github.com/users/davidagold/repos","events_url":"https://api.github.com/users/davidagold/events{/privacy}","received_events_url":"https://api.github.com/users/davidagold/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T01:25:08Z","updated_at":"2015-09-18T01:25:08Z","body":"Oh, nevermind. That's not how `isdefined` works -- the index refers to the number of the field in the type, I suppose. Closing this."}}