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

Fix #28 by removing Vector convenience functions #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dingraha
Copy link
Collaborator

#28 shows that creating Vectors of eg Sections fails with the latest stable Julia 1.11.2, apparently due to the convenience functions like

function Base.getproperty(obj::AbstractVector{<:OperatingPoint}, sym::Symbol)

This PR removes those functions and fixes up the tests. I tried changing Base.getproperty(obj::AbstractVector{...}, ...) to Base.getproperty(obj::Vector{...}, ...) but that didn't appear to help.

I know this is a breaking change, sorry. :-(

@dingraha
Copy link
Collaborator Author

@andrewning polite ping. :-)

@andrewning
Copy link
Member

Thanks for initiating! I think there might some changes needed in the docs too, but I haven't had a chance to check yet.

@andrewning
Copy link
Member

might be worth using StructArrays.jl we use the dot syntax quite a bit downstream.

@andrewning
Copy link
Member

This seems to work (I haven't tested it throughout, just a MWE).

function Base.getproperty(obj::AbstractVector{<:OperatingPoint}, sym::Symbol)
    if sym != :ref
        return getfield.(obj, sym)
    else
        return getfield(obj, sym)
    end
end

@andrewning
Copy link
Member

I just pushed that change. looks like it fixes the problem so we don't have to remove this convenience function.

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

Successfully merging this pull request may close these issues.

2 participants