Skip to content

Commit

Permalink
Add some comments to patch for StaticArray
Browse files Browse the repository at this point in the history
  • Loading branch information
N5N3 committed Feb 21, 2022
1 parent 5dfba5a commit a92bc41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/staticarrays_support.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ end
StructArrays.component(s::FieldArray, i) = invoke(StructArrays.component, Tuple{Any, Any}, s, i)
StructArrays.createinstance(T::Type{<:FieldArray}, args...) = invoke(createinstance, Tuple{Type{<:Any}, Vararg}, T, args...)

# StaticArrayStyle has no similar defined.
# Convert to `DefaultArrayStyle` to return a sized (Struct)Array.
# TODO: return a StaticArray?
function Base.copy(bc::Broadcasted{StructArrayStyle{StaticArrayStyle{N},N}}) where {N}
B = convert(Broadcasted{StructArrayStyle{Broadcast.DefaultArrayStyle{N},N}}, bc)
copy(B)
bc′ = convert(Broadcasted{StructArrayStyle{Broadcast.DefaultArrayStyle{N},N}}, bc)
return copy(bc′)
end

0 comments on commit a92bc41

Please sign in to comment.