{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11357","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11357/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11357/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11357/events","html_url":"https://github.com/JuliaLang/julia/issues/11357","id":78195781,"number":11357,"title":"Tuple bug (`getindex` has no method matching getindex(::Void, ::Int64))","user":{"login":"yurivish","id":114388,"avatar_url":"https://avatars.githubusercontent.com/u/114388?v=3","gravatar_id":"","url":"https://api.github.com/users/yurivish","html_url":"https://github.com/yurivish","followers_url":"https://api.github.com/users/yurivish/followers","following_url":"https://api.github.com/users/yurivish/following{/other_user}","gists_url":"https://api.github.com/users/yurivish/gists{/gist_id}","starred_url":"https://api.github.com/users/yurivish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurivish/subscriptions","organizations_url":"https://api.github.com/users/yurivish/orgs","repos_url":"https://api.github.com/users/yurivish/repos","events_url":"https://api.github.com/users/yurivish/events{/privacy}","received_events_url":"https://api.github.com/users/yurivish/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-19T18:14:44Z","updated_at":"2015-05-21T18:02:57Z","closed_at":"2015-05-21T18:02:57Z","body":"I ran into what appears to be a bug involving the new tuple types using the latest Julia nightly (julia-0.4.0-c777d31727-osx).\r\n\r\nThere is a type, `ByteRGB`, which I want to change to a tuple type, so I replaced this\r\n```julia\r\nimmutable ByteRGB\r\n\tr::UInt8\r\n\tg::UInt8\r\n\tb::UInt8\r\nend\r\nBase.length(c::ByteRGB) = 3\r\nBase.getindex(c::ByteRGB, n) = c.(n)\r\n```\r\n\r\nwith this:\r\n```julia\r\ntypealias ByteRGB Tuple{UInt8, UInt8, UInt8}\r\nByteRGB(r, g, b) = (r::UInt8, g::UInt8, b::UInt8)\r\n```\r\n\r\nwhich results in this when running a program that works fine with the non-tuple definition:\r\n\r\n```\r\nERROR: LoadError: MethodError: `getindex` has no method matching getindex(::Void, ::Int64)\r\n in anonymous at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_apply at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_interpret at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_interpret at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_interpret at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_interpret at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)\r\n in abstract_call_gf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval_call at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in abstract_eval at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_uncached at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in typeinf_ext at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in placepixels at /Users/yurivish/Dropbox/Public/Magic/code/placepixels.min.jl:113\r\n in generate_art at /Users/yurivish/Dropbox/Public/Magic/code/generate.jl:25\r\n in generate_card at /Users/yurivish/Dropbox/Public/Magic/code/generate.jl:16\r\n in create_variations at /Users/yurivish/Dropbox/Public/Magic/code/magic.jl:56\r\n in anonymous at no file:83\r\n in include at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in include_from_node1 at loading.jl:134\r\n in process_options at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\n in _start at /Applications/Julia-0.4.0-dev.app/Contents/Resources/julia/lib/julia/sys.dylib\r\nwhile loading /Users/yurivish/Dropbox/Public/Magic/code/magic.jl, in expression starting on line 60\r\n```\r\n\r\nLine 113 in placepixels.min.jl is `candidate = nearest(canvas.frontier, color)` where color is of type `ByteRGB` and the function `nearest` is defined inside a [package I wrote](https://github.com/yurivish/LowDimNearestNeighbors.jl/blob/master/src/LowDimNearestNeighbors.jl#L153). \r\n\r\nThe full program is somewhat extensive and I haven't been able to successfully make a reduced test case. If the bug is not diagnosable from the information I've given here, then I can try to get a better stack trace. What's the best way to do so?"}}