Seis.jl
Seis.jl copied to clipboard
Eliminate type piracy—add container `<: AbstractArray` types?
Seis.jl has always used getproperty (.-access) to get at and set nested properties of things like Array{<:Trace}s. This worked fine when (pre Julia v1.11) Array was implemented in C and the type didn't have Julia fields to access. Nonetheless, this has always been type piracy, and now this will cause invalidations.
In a future major breaking version of Seis.jl, we should stop committing type piracy and probably instead only enable .-access for new container array types which we own. This will require implementing the full AbtractArray and broadcasting interfaces on a type like:
struct TraceArray{T<:AbstractTrace,N} <: AbstractArray{T,N}
traces::Array{T,N}
end
Triggered by https://github.com/JuliaLang/julia/issues/56100