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

Eliminate type piracy—add container <: AbstractArray types? #46

Open
anowacki opened this issue Oct 11, 2024 · 1 comment
Open

Eliminate type piracy—add container <: AbstractArray types? #46

anowacki opened this issue Oct 11, 2024 · 1 comment

Comments

@anowacki
Copy link
Owner

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
@anowacki
Copy link
Owner Author

anowacki commented Oct 11, 2024

Triggered by JuliaLang/julia#56100

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