Skip to content

Require ArrayInterfaceStaticArrays to fix downstream - #205

Merged
ChrisRackauckas merged 1 commit into
masterfrom
sa
May 24, 2022
Merged

ChrisRackauckas merged 1 commit into
masterfrom
sa

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

No description provided.

@ChrisRackauckas

ChrisRackauckas commented May 24, 2022 •

Copy link
Copy Markdown
Member Author

@oschulz this is a bit of a tragedy. But there's a test that shows it's necessary, because of how this is implemented:

@generated function ArrayInterfaceCore.ismutable(::Type{<:ArrayPartition{T,S}}) where {T,S}
    res = all(ArrayInterfaceCore.ismutable, S.parameters)
    return :( $res )
end

which needs the dispatch for static arrays already defined for this to be resolved correctly, since it doesn't check the back edges.

@oschulz

oschulz commented May 24, 2022

Copy link
Copy Markdown

I guess that brings us back to the question "what would we need in a StaticArraysCore"?

@ChrisRackauckas
ChrisRackauckas merged commit 8add4db into master May 24, 2022
@ChrisRackauckas
ChrisRackauckas deleted the sa branch May 24, 2022 14:12
@oschulz

oschulz commented May 24, 2022

Copy link
Copy Markdown

which needs the dispatch for static arrays already defined

Sorry, I don't see it right now - which specialization is the critical one?

@ChrisRackauckas

Copy link
Copy Markdown
Member Author

Once again, this would only need SArray in there to know to mark it as ismutable false. So, the same little subset, nothing changed.

@ChrisRackauckas

Copy link
Copy Markdown
Member Author

Sorry, I don't see it right now - which specialization is the critical one?

ArrayInterfaceCore.ismutable(::Type{<:SArray}) = false is all.

@ChrisRackauckas

Copy link
Copy Markdown
Member Author

IMO, first push to Base should probably be to get that concept in Base. I don't know how people could write code without, it's insane that it still doesn't exist.

@oschulz

oschulz commented May 24, 2022

Copy link
Copy Markdown

Can't we just ask StaticArrays.jl to depend on ArrayInterfaceCore.jl and define it? :-)

@oschulz

oschulz commented May 24, 2022 •

Copy link
Copy Markdown

ArrayInterfaceCore.jl is so light now, so it would seem natural to define

ArrayInterfaceCore.ismutable(::Type{<:SArray}) = false

in StaticArrays.jl, right?

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