Skip to content

add firstindex support, x[begin]Β #78

@visr

Description

@visr

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions