Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add firstindex support, x[begin] #78

Open
visr opened this issue Aug 15, 2023 · 0 comments
Open

add firstindex support, x[begin] #78

visr opened this issue Aug 15, 2023 · 0 comments

Comments

@visr
Copy link
Member

visr commented Aug 15, 2023

This errors for all GeoJSON types that otherwise support getindex:

using GeoJSON
p = GeoJSON.read("""{"type":"Point","coordinates":[30,10]}""")
p[begin]  # MethodError: no method matching firstindex(::GeoJSON.Point{2, Float32})

x[end] does work so I guess that has a fine fallback.
I assume this is a matter of Base.firstindex(...) = 1 for a few types.

https://docs.julialang.org/en/v1/manual/interfaces/#Indexing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant